Reading Time: 2 minutes

In my previous post i wrote about Azure Cosmos DB. In this one i will talk about migration methods to Cosmos DB.
Download Azure Document DB migration tool from here.
DocumentDB Data Migration Tool gives you the ability to migrate data from different sources to Cosmos DB.

Important Notice : For this demo we use the same Cosmos DB database from the previous post “Let’s talk about Azure Cosmos DB”

Migration from SQL DB

For this demo you should download AdventureWorks2017 database from here.

Source Information

Select from the drop-down menu [SQL], Type database connection string and click Verify

Important Notice : Don’t  take as example my connection string, it is not compliant with GDPR.

In the next step you can Enter Query or Select an existing query for import.

Target Information

At the Target information form, select where you want to export the data, e.g DocumentDB – Sequential record import (partitioned collection), add  Cosmos DB Connection String (From the  Azure Portal, SettingsKeys – {PRIMARY CONNECTION STRING}). Type Collection Name , e.g Items. Type Partition Key, e.g /Id and finally set the Collection Throughput, e.g 100

Advanced

In the Advanced configuration select the path you want Error Log File saved and choose the Detailed Error Information.

Summary

In the summary page you can confirm all the import settings, e.g Source (SQL) – Connection String, Query, etc. Target (DocumentDB – Sequential record import (partitioned collection)), Connection String, Collection, Partition Key, etc. If summary look fine, then click [Import] to start process.

Results

Finally, in the Import results page you can see that 18508 records transferred to Azure Cosmos DB (ToDoList) in 0:02:28:07 minutes.

Share This