is there an option in Azure to export an existing collection from DocumentDB?
I could only seen an Import option.
is there an option in Azure to export an existing collection from DocumentDB?
I could only seen an Import option.
There is no built-in export option in the database service itself. However, the DocumentDB Data Migration Tool, published by the DocumentDB team, is available and provides both import and export capabilities (export is to JSON). Everything is documented on the DocumentDB area of the Azure site, specifically here.
This isn't your only option, as you can write your own export app based on one of the existing language SDKs or direct REST API calls.
There may be other tools available, but getting into a which is the best tool for this discussion is off-topic. I'm only pointing out the Data Migration tool because the DocumentDB team provides it, along with official documentation.
Surprisingly, as of ~mid-2017 there still not does not appear to be a simple "Download DB" and "Upload DB" type functionality for Azure CosmosDB (previously known as DocumentDB). Here is one option:
Caveat: Below method does not appear to support exporting attachments. If that is something you need, this might not work for you.
Use the Azure DocumentDB Data Migration Tool to export and import DocumentDB collections.
In Source Information Page:
DocumentDB
as sourceAccountEndpoint=http://blah.documentdb.com/;AccountKey=blahblah;Database=dbname
To export, select "JSON file" as target and your documentDB as sourceVerify
to ensure your connection works.JSON
.Local File
and enter a valid path.Prettify JSON
Tested: 2017-06-16 against an Azure CosmosDB instance
Use the Azure DocumentDB Data Migration Tool to export and import DocumentDB collections.
To export, select "JSON file" as target and your documentDB as source
UPDATE : new (better) version is avalible here : https://github.com/Azure/azure-documentdb-datamigrationtool
Use MongoExport if you've enabled the Mongo interface in Cosmos: https://www.mongodb.com/docs/database-tools/mongoexport/.
© 2022 - 2024 — McMap. All rights reserved.