Import data from .ravendbdump file
A .ravendbdump
file is RavenDB format for exporting a database to file in order to change versions. It is backward compatible between RavenDB versions.
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.
Importing Database From File
- Tasks
In the destination server, click Tasks tab. - Import Data.
Click to see various impoprt options. - From file (.ravendbdump)
Seclect to import from a source database which has previously been exported. - 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. - Select file
Select the.ravendbdump
file that you previously exported from the source server. - 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. - Advanced
Click to configure [advanced import options] - 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.
Import Options
-
Include Documents
Toggle to include documents and to enable inclusion of the following document related items:- Include Attachments
- Include Legacy Attachments
Determines whether or not legacy attachments contained in the file should be imported where legacy attachments refers to v2.x and v3.x attachments. - Include Counters
- Include Legacy Files
- Include Artificial Documents
- Include Expired Documents
- Include Revisions
- Include Conflicts
-
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.
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.
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:
- Periodic Backups
- External replications
- ETL Tasks - Extract, Transform, Load
- Pull Replication Sinks
- Pull Replication Hubs
Other:
- Settings
- Conflict Solver Configuration
- Revisions Configuration
- Document Expiration
- Client Configuration
- Custom Sorters
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.
Import Command Powershell
- Generates the commands to run the importing logic from PowerShell based on your configurations above.