Step #1: Prepare Servers for the Import Process (Secure 4.x Servers Only)
Perform this step only if your source RavenDB server is a secure 4.x server that is running on HTTPS. For other servers, skip this step and continue to Step 2.
Data from a secure 4.x RavenDB server (running on HTTPS) can only be imported to a destination server that is also secure.
For the import to take place, the destination server needs to access the existing source database and fetch data from it.
To grant such access, you must first register the destination server certificate as a client certificate on your source server.
To accomplish this, follow these steps:
1. Export the destination RavenDB certificate
Go to Manage Server -> Certificates view on the destination RavenDB Studio. (See Certificates Management).
Choose Export Cluster Certificates option from the Cluster Certificate dropdown.
Export the destination server certificate
2. Register this certificate on the source RavenDB server
Go to Manage Server -> Certificates view on the source RavenDB Studio.
Choose Upload client certificate to upload the exported certificate as the client certificate.
Register exported certificate as client certificate
3. Set the certificate details Certificate Name - Provide a meaningful name for this certificate. Security Clearance - Security clearance User will provide the necessary access for the data migration purposes. Database Permissions - Remember to add Read/Write permission to the database you want to import.
Set certificate details
4. Click Upload to complete the upload process.
Step #2: Access the Import View
1. On the destination RavenDB server, select a database into which the data will be imported. Note: Verify this database is empty as the importing will overwrite any existing content.
Databases List View
2. Select Settings and then Import Data under the Tasks submenu.
Go to Import Data View
3. Select From RavenDB.
Select 'From RavenDB'
Step #3: Set the Source Server URL and database
Specify the source server URL and select the database to import the data from.
Server URL - URL to server you want to import from. You can specify URL to either 4.x server or 3.x server.
Server Version - The version of the server that you want to import from will show here once you enter the URL.
Database Name - The name of the Database that you want to migrate your data from.
If any of the options is set but the source database doesn't contain any items of that type, the type will be skipped.
Step #5: Advanced Import Options
Advanced Import Options - Transform Script
Use Transform Script:
// Example 1
// The script above will delete the existing change-vector from imported documents,
// New change vectors will be generated during the import.
// This is very helpful if the data is imported from a different database-group
// and you want to avoid adding old change-vector entries to a new environment.
// Example 2
this.collection = this['@metadata']['@collection'];
// This script will create a new 'collection' property in each imported document.
Customize Configuration and Ongoing Tasks
Advanced Import Options - Customize Configuration and Ongoing Tasks
Periodic Backups: Determines whether or not Periodic Backups tasks configuration should be imported.
External replications: Determines whether or not External replications tasks configuration should be imported.
RavenDB ETLs: Determines whether or not RavenDB ETLs tasks configuration should be imported.
SQL ETLs: Determines whether or not SQL ETLs tasks configuration should be imported.
Pull Replication Sinks: Determines whether or not Pull Replication Sinks tasks configuration should be imported.
Pull Replication Hubs: Determines whether or not Pull Replication Hubs tasks configuration used by indexes should be imported.
Settings: Determines whether or not Settings should be imported.
Conflict Solver Configuration: Determines whether or not Conflict Solver Configuration should be imported.
Revisions Configuration: Determines whether or not Revisions Configuration should be imported.
Document Expiration: Determines whether or not Document Expiration settings should be imported.
Client Configuration: Determines whether or not Client Configuration should be imported.
Custom Sorters: Determines whether or not Custom Sorters should imported.
RavenDB Connection Strings: Determines whether or not RavenDB Connection Strings should be imported.
SQL Connection Strings: Determines whether or not SQL Connection Strings values should be imported.