Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Migrating Data From RavenDB 3.5 to 4.0

DZone's Guide to

Migrating Data From RavenDB 3.5 to 4.0

Learn a few methods of how to get your data from RavenDB 3.5 into RavenDB 4.0 whether you're doing a one-time operation or a long process.

· Database Zone ·
Free Resource

RavenDB vs MongoDB: Which is Better? This White Paper compares the two leading NoSQL Document Databases on 9 features to find out which is the best solution for your next project.  

One of the first steps you’ll have when migrating RavenDB from 3.5 to 4.0 is to actually get your data in 4.0. There are a few ways of doing that.

You can create a new database in 4.0 from a 3.5 database directory. You can click on the chevron on the New database button to access it:

image

This will give you the following screen, where you can point to the existing database directory (the RavenDB 3.5 server must be offline for this) and the Raven.StorageExporter tool that comes with the 3.5 distribution. RavenDB 4.0 will then create your database and import all the data from the existing database to the new one.

image

This works great if you are doing this is a one-time operation, but in many cases, the migration process is a long one. You’ll start by migrating your code, and it will take one or two iterations to complete the full process.

To handle that scenario, you’ll create a new database on 4.0 normally, then go to Settings > Import and select Importing from another database. In this mode, the 3.5 server is online and running. You’ll provide the details of the server and database and then click on Migrate Database, as you can see in the picture.

image

This will import all the data from the existing database to the new database. This can be an ongoing process. Once this is done, you can migrate your application code to use RavenDB 4.0 and at deployment time, you’ll run this again.

Each time you run this migration, it will get only the updated data from the source server — it doesn’t have to read it all from scratch.

Do you pay to use your database? What if your database paid you? Learn more with RavenDB.

Topics:
data migration ,database ,ravendb ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}