Migrate MongoDB To CosmosDB
Migrate MongoDB To CosmosDB
You can use Azure Database Migration Service to perform an offline (one-time) migration of databases
from an on-premises or cloud instance of MongoDB to Azure Cosmos DB's API for MongoDB.
Mongodb Cosmos db
Provide a name for the new migration project and select the source server type as mongodb and
target server type as Cosmos db (mongodb API). And select migration type as offline data migration
and click Create and run activity
On the next pane enter the source server details and click Save
On the next pane enter the migration target details. In this case select Cosmos DB target as Mode
and choose your subscription and then select the cosmos DB from the dropdown and click Save.
On the Map to target databases screen, map the source and the target database for
migration. If the target database contains the same database name as the source database,
Azure Database Migration Service selects the target database by default. If the string Create
appears next to the database name, it indicates that Azure Database Migration Service didn't
find the target database, and the service will create the database for you.
In the next step choose the Collection you want to migrate and set the throughput and shard key
value. Leave both as blank for default values. Click Save.
On the next step you can see the migration summary. Give an activity name and Click Run migration
to start the migration process.
You can monitor the activity of the migration in the next tab.
Click refresh button to see the updated status. Wait till the status shows complete.
Use MongoDB compass or studio 3T to connect to cosmos DB and check the data