From Local to Live: Moving Your MongoDB Data to Atlas

This blog gives you a clear understanding of how to migrate your data from MongoDb Compass to MongoDB Atlas (Cloud) . Follow these steps to migrate your data.

  • Open your Mongodb atlas and go to Clusters. click on CONNECT button. You will be navigated to new popup showing different ways you can connect. 
  • click the compass option . After that you will see an connection string  for connection .copy it. replace the <username> and <password> with your atlas username and password to complete the connection string .

  • DEMO: 
                 
    mongodb+srv://<username>:<db_password>@myatlasclusteredu.cbedltk.mongodb.net/
  • go to mongodb compass.

  • In the landing page you click on the + icon near the connection to create a new connection
          

  • inside the connection details page, paste the url to establish the connection to atlas.
   

  • after that you have you atlas databases
  • create a document inside the atlas connection similar to that of compass documents,the name should be the same
  • after creating all the document name similar to that of compass documents. In the compass DB go to each document 
  • click on EXPORT DATA 
  • click on EXPORT THE FULL COLLECTION
  • click the JSON option and export it .It would be downloaded in your system


  • Now navigate to you atlas connection under each document Click on ADD DATA
  • click on IMPORT JSON OR CSV


  • now select the json file we have downloaded from compass.
  • click on Import
  • Now you you have successfully transferred the documents from compass(local) to atlas(Cloud)

Comments