Migrating Mongo DB to Azure Cosmos DB using Migration Tool

Nimai Ahluwalia
AnalyticsHere
Published in
3 min readSep 19, 2020

Why Cosmos DB?

Today’s applications are required to be highly responsive and always online. To achieve low latency and high availability, instances of these applications need to be deployed in data centers that are close to their users. Applications need to respond in real-time to large changes in usage at peak hours, store ever-increasing volumes of data and make this data available to users in milliseconds.

Solutions that benefit from Azure Cosmos DB by Microsoft

Any web, mobile, gaming, and IoT application that needs to handle massive amounts of data, reads, and writes at a global scale with near-real response times for a variety of data will benefit from Cosmos DB’s guaranteed high availability, high throughput, low latency, and tunable consistency. Learn about how Azure Cosmos DB can be used to build IoT and telematics, retail and marketing, gaming and web and mobile applications.

Migration

Create a Cosmos DB account with the SQL API

When we are using the software for the migration it only supports 1-time migration also equivalent to the Offline migration of DMS

Step 1:

Select the Source

Make the connection with the on-premises Mongo DB server which is running on your local machine by passing the connection string and specifying the collection make selected to migrate

We careful while selecting the Collections as they should be in the database which is specified in the Connection String.

Step 2:

Select the Target

We must select the option where we want to migrate the data it has only few options to which we can.

Here we must specify the Connection String of the Cosmos DB which we will get on the Azure Portal in the Key Section of the Cosmos DB account, there we must select the primary key option as it contains all the necessary endpoints and the password.

The connection string does not consist of the database to which the data will be stored so must add the database name to it which should be created beforehand and the container with the same partition key.

We must also specify the name of the collection and the partition key.

And set the Throughput according to your need.

Step 3:

Skip the Advanced Setting and look in the Summary for the confirmation of the migration and click on the import button and wait for it to get completed without any error.

Step 4:

Check the amount of the Transferred data whether it matches with the amount in the Source Data.

Source Data:

Destination Data in Azure:

--

--

Nimai Ahluwalia
AnalyticsHere

Data Analyst, Power BI, Azure, SQL ,Data Migration,|| MCT Certified || || AZ-900 Certified || DA-100 Certified || DP-900 Certified ||