From self-managed MongoDB to Azure DocumentDB

Follow these simple instructions to get dsync up and running and perform a migration from your self-managed MongoDB to an Azure DocumentDB or Cosmos DB destination.

Step 1: Download dsync

Adiom on Azure Marketplacearrow-up-right

circle-info

Working on a large-scale production environment? Use our horizontally scalable Enterprise offering.

Use Docker (markadiom/dsync) or download the latest release from the GitHub Releasesarrow-up-right page. Note that on Mac devices you may need to configure a security exception to execute the binary by following these stepsarrow-up-right.

Alternatively, you can build dsync from the source code.

git clone https://github.com/adiom-data/dsync.git
cd dsync
go build

Step 2: Prepare the source MongoDB instance

circle-exclamation
  1. Start a local MongoDB instance

  2. Load sample data

# Start a new mongod instance on localhost:27017 with dbpath ~/temp/data_d

mkdir ~/temp
cd ~/temp
mkdir data_d
mongod --dbpath data_d --logpath mongod_d.log --fork --port 27017

# Load sample data
git clone https://github.com/mcampo2/mongodb-sample-databases
cd mongodb-sample-databases
mongorestore dump/sample_mflix

Step 3: Prepare the destination DocumentDB instance

circle-exclamation

Follow official Azure documentation to set up a DocumentDB instance. For example, these are the instructions for setting up Azure DocumentDB (formerly Cosmos DB vCore for MongoDB) instance using Azure Portal: https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/quickstart-portalarrow-up-right

Make sure to note the DocumentDB cluster MongoDB connection string: https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/quickstart-portal#get-cluster-credentialsarrow-up-right


Step 3: Start dsync

Now Dsync should be running! Feel free to interrupt the sync process (via Ctrl+C) it once the initial sync is done. The sample database has a few million records - allow 5-10 minutes for the process to complete.


Step 4: Check the data

Congratulations! You should be able to access the 'sample_mflix' database and see the collections in it that were migrated from the local MongoDB instance.


Contact us

Please reach out to us by emailenvelope and on Discordarrow-up-right for commercial inquiries and support.

Last updated