Can I restore an atlas cluster snapshot on a different cluster?

Is there an easy way to restore data from one cluster to another cluster. For example to restore a Test cluster from a Production cluster snapshot ?

These may be in different accounts and different projects.

Thanks

1 Like

Hi @Duncan_Groenewald,

Is there an easy way to restore data from one cluster to another cluster. For example to restore a Test cluster from a Production cluster snapshot ?

If the clusters are within the same organisation it’s a bit easier. You’ll need the Project Owner in both the project where the backup exists and the project where you wish to restore the backup to.

You can follow the steps outlined in the Restore your Snapshot to an Atlas Cluster documentation for restoring a backup from your “Production” cluster to a “Test” cluster.

These may be in different accounts and different projects.

For the different accounts scenario you can download and restore the snapshot locally - You may find the procedure documentation for this useful.

After downloading the backup (which is in .tar.gz format), you’ll need to:

  • Extract the .tar.gz backup file
  • Run a mongod process on your local machine which will use this extracted directory as the data directory. (Example is included in the linked procedure documentation above as well)
  • Run the mongodump tool to dump the entire data in the json format inside a specified directory.
  • Run the mongorestore tool to restore the data in the specified directory to the target MongoDB Atlas cluster.

Both mongorestore and mongodump are available within the MongoDB database tools which you can download. Additionally, I would recommend referring to the Connect to a cluster using command line tools
documentation in assisting with the base command(s) to run for these tools.

Please note that it is necessary to whitelist the client(s) IP address(es) in the source and target MongoDB Atlas projects.

Hope this helps.

Jason

4 Likes

@Jason_Tran - thanks in the end I just used mongodump and mongorestore from/to the Atlas Clusters directly but it is useful to know the steps for doing so directly from a snapshot.

Thanks

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.