Search code examples
azure-cosmosdbazure-cosmosdb-emulator

How can I copy Cosmos DB Emulator data to another machine?


I am developping using the Azure Cosmos DB emulator. I have about 8 databases in my container. Some with triggers, most with a bunch of test data.

How can I export the databases "definitions" and data to import into an emulator on another machine? I do not see any "Export" nor "Import" options in the explorer. And I tried to copy the CosmosDBEmulator folder to no avail.

Also, when time to create my actual Azure account, how can I export the container and databases definitions (settings like time to live, partition key, as well as triggers, etc) so I can recreate my environment ?

But really, short term, all I need is to be able to replicate the databases on another machine.


Solution

  • The Emulator does not have any feature to import/export data as of now. You might need to migrate the data manually for now.

    You can write your own script using SDK or using any of the tools mentioned here for NOSQL API.