Import data from .ravendbdump file


  • .ravendbdump is RavenDB's format for exportation of data into and from files.

  • RavenDB dump files can be used to easily migrate data from one database to another. They are commonly used when the database is upgraded.

  • an exported .ravendbdump file can be used to migrate the data stored in a non-sharded database into a sharded database.
    Learn more about this operation in the section dedicated to it.

In this page:


Import data to destination server from file

If you have already exported a database, follow these steps in the studio when you're ready to import from file.

Figure 1. Importing Database From File

Importing Database From File

  1. Tasks
    In the destination server, click Tasks tab.
  2. Import Data.
    Click to see various impoprt options.
  3. From file (.ravendbdump)
    Seclect to import from a source database which has previously been exported.
  4. Warning
    Make sure that you are not writing over data that you want to keep.
    One option is to start a new database with the studio.
  5. Select file
    Select the .ravendbdump file that you previously exported from the source server.
  6. Documents and Extensions
    Select desired options.
    If you encrypted while exporting make sure to select imported file is encrypted.
    You will need to paste the encryption key that you saved when creating the encrypted database.
  7. Advanced
    Click to configure [advanced import options]
  8. Import Database
    Click after configuring the new database to finalize the import task.

Import options

Here you can filter the data you want to import, select configuration and apply a transform script on your documents.

Figure 2. Import Options

Import Options

  1. Include Documents
    Toggle to include documents and to enable inclusion of the following document related items:

  2. Include Indexes

  3. Imported file is encrypted
    Toggle to include the decryption key when importing data from encrypted file.
    Make sure that Encrypt exported file option was selected when exporting from source database so that the encryption key is included.

Import settings for items that don't exist in source database

If any of the options is set but the source database doesn't contain any items of that type, the item will be skipped.

Advanced import options

Click the Advanced button at the bottom of the options view for the following import features.

Transform Script

In the Studio, select database > click Task tab > select Import > select From file (.ravendbdump) > click the Advanced button at the bottom > toggle Use Transform script.

Figure 3. Advanced Import Options - Transform Script

Advanced Import Options - Transform Script

  • Use Transform Script
    Enabling this advanced option allows you to provide a transform javascript, that would operate on each document imported from the file.

Sample transform javascript:

delete this['@metadata']['@change-vector']
  // The script above will delete the change-vector from imported documents
  // and will generate new change vectors during import. 
  // This is very helpfull if the data is imported from a diffrent database group
  // and you want to avoid adding old change vector entries to a new environment.

Customize Configuration and Ongoing Tasks

This advanced option enables you to choose whether to import various ongoing tasks, connection strings and advanced configurations.

In the Studio, select database > click Task tab > select Import > select From file (.ravendbdump) > click the Advanced button at the bottom > toggle Customize configuration and Ongoing Tasks.

Figure 4. Advanced Import Options - Customize Configuration and Ongoing Tasks

Advanced Import Options - Customize Configuration and Ongoing Tasks

Toggle to include the following configurations and ongoing tasks.
If a task is included but doesn't exist in your source database, it will be skipped.

Ongoing tasks:

Other:

Connection Strings:

  • Connection Strings used by ETL tasks to authenticate and connect to external databases will be imported.

Copy command as PowerShell

In the Studio, select database > click Task tab > select Import > select From file (.ravendbdump) > click the Advanced button at the bottom.

Figure 5. Import Command Powershell

Import Command Powershell

  • Generates the commands to run the importing logic from PowerShell based on your configurations above.