Skip to main content

Import data from .ravendbdump file

Import data from a file

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

Importing a database from a file

  1. Select the Tasks menu.

  2. Open the Import data view.

  3. From file tab.
    Select the From file (.ravendbdump) tab to import from a database that was previously exported to a file.

  4. Overwrite warning.
    Be aware that importing from a file will overwrite any existing documents and indexes that share the same IDs.
    To avoid rewriting your data, you can create a new database and import into it.

  5. Select file.
    Choose the exported .ravendbdump file that you want to import data from, by entering the file name or browsing your file system.

  6. Import options
    Select the data to import from the file. See Import options below.
    If you exported an encrypted file, enable Imported file is encrypted and provide the encryption key.

  7. Advanced
    Present advanced import options.

  8. Import Database
    Click to import the selected data.

Import options

Import options

Select the entities that you want to import:

1. Documents and Extensions2. Cluster Entities
DocumentsIndexes
   Attachments   Index history
   Legacy attachments   Remove analyzers
   CountersIdentities
   Time seriesSubscriptions
   RevisionsConfiguration and Ongoing Tasks
Artificial documentsCompare exchange items
Archived documentsCompare exchange tombstones
Expired documents
Conflicts
Document tombstones
Time-series deleted ranges

Options that are selected but have no matching items in the imported file are skipped during import.

3. Imported file is encrypted
Enable this option when importing from an encrypted file, and provide the decryption key.
Make sure that Encrypt exported file was enabled when exporting from the source database.

Advanced import options

Click Advanced to reveal the following options.

Advanced import options

1. Import all collections

Import specific collections

By default, all exported collections are imported.
To import only specific collections, disable Import all collections, enter the name of each collection that you want to import, and click Add collection.
Enter collection names exactly as they appear in the source database.

2. Use Transform script

Use transform script

Enable this option to provide a JavaScript transform script that runs on each document imported from the file.

The current document is available under the this variable.
The @change-vector, @id, and @last-modified metadata fields are not available to the script.

For example, use the following script to skip discontinued products and stamp every imported document with the time it was imported:

// Skip documents you don't want to import
// (throwing 'skip' filters the document out)
if (this.Discontinued === true) {
throw 'skip';
}

// Add or modify regular fields on the imported document
this.ImportedAt = new Date().toISOString();

3. Customize Configuration and Ongoing Tasks

Customize configuration and ongoing tasks

Use this option to select ongoing tasks, configurations, and connection strings to import.
Selected options with no matching items in the imported file will be skipped during import.

Ongoing tasksOtherConnection Strings
Periodic backupsSettingsRavenDB connection strings
External replicationsConflict solver configurationSQL connection strings
RavenDB ETLsClient configurationSnowflake connection strings
SQL ETLsRevisions configurationOLAP connection strings
Snowflake ETLsDocument refreshElasticsearch connection strings
OLAP ETLsDocument expirationQueue connection strings (Kafka, RabbitMQ, Azure queue storage)
Elasticsearch ETLsDocuments compressionAI connection strings
Queue ETLs (Kafka, RabbitMQ, Azure queue storage)Time series configuration
Replication hubsCustom sorters
Replication sinksCustom analyzers
Embeddings GenerationPostgreSQL integration
GenAIAI agents
Remote attachments

Imported ongoing tasks are disabled by default.

4. Set Max Read Operations Per Second

Set max read operations per second

Enable this option to set a maximum number of read operations per second for the import.
Capping this rate makes the import lighter on the server, leaving more capacity for other work running on the database while the import is in progress, at the cost of a slower import.

5. Import Command

Import command

Studio can generate a ready-to-run command that performs this same import from a command line, using the options you configured above.
This is useful for repeating the import later or running it from a script.

Select the format you need, PowerShell, Cmd, or Bash, then click the copy icon to copy the generated command to the clipboard.

The command uses curl to send your .ravendbdump file and the selected options to the database's import endpoint.
For example, the generated PowerShell command looks similar to this:

curl.exe -F 'importOptions={\"OperateOnTypes\":\"Documents,Indexes\",\"IncludeExpired\":true}' -F 'file=@.\Northwind.ravendbdump' http://127.0.0.1:8080/databases/Northwind/smuggler/import

In this article