Navigation
  • Restoration >
  • Restore a Cluster from an M2/M5 Snapshot

Restore a Cluster from an M2/M5 Snapshot

Atlas lets you restore data from an M2 or M5 cluster snapshot. You can restore M2 and M5 snapshots to a cluster tier M2 or greater.

Restore Restrictions

  • Atlas can only restore M2 and M5 snapshots to a replica set that does not use Encryption at Rest.
  • The target cluster must run the same major release version of MongoDB as the snapshot MongoDB version. For example, you can only restore a snapshot using MongoDB 4.0 to a target cluster running MongoDB 4.0.

Prerequisites

  1. You must ensure that the target Atlas cluster does not receive client requests during restoration. You must either:
    • Restore to a new Atlas cluster and reconfigure your application to use that new cluster once the new deployment is running, or
    • Ensure that the target Atlas cluster cannot receive client requests while you restore data.
  2. To download your snapshot via HTTPS, you must add the IP or CIDR addresses of the client downloading the snapshot to your Atlas project whitelist.

Procedure

  1. From the Clusters view, click the cluster name.
  2. Click the Backup tab.
  3. Find the desired cluster snapshot to restore.
  4. For the desired cluster, click Restore or Download.
  5. Follow the prompts to restore your cluster. You may choose to:

Download your Snapshot via HTTPS

  1. In the Snapshots tab, locate the snapshot you wish to download in the All Daily Snapshots table.
  2. In the Actions column of the table, click Download.
  3. In the Download prompt, click either Copy Link or Download to download the snapshot.
    • When you click Copy Link, Atlas generates a download link that expires within 4 hours. You can use this link multiple times prior to its expiration.
    • When you click Download, the download process begins immediately.

Atlas compresses the snapshot into a .tar.gz file. Use your preferred archive utility to extract the archive and access the data files.

Once extracted, you can access the data files by starting a mongod instance on the host and pointing it at the extract directory using the --dbpath option.

Example

The following command uses the tar utility to extract a tar archive with gzip compression:

tar -xvzf ~/Downloads/mongodb-snapshots/my-cluster-snapshot.tar.gz

The following command starts a mongod instance using the extracted data file directory:

mongod --dbpath ~/Downloads/mongodb-snapshots/my-cluster-snapshot/

Restore your Snapshot to an Atlas Cluster

Important

Atlas deletes all existing data on the target cluster prior to the restore. The cluster will be unavailable for the duration of the restore.

You can restore to any Atlas cluster in a project for which you have the Project Owner role.

  1. In the Snapshots tab, locate the snapshot you wish to restore in the All Daily Snapshots table.
  2. In the Actions column of the table, click Restore.
  3. From the Restore dialog, select the target cluster to which you want to restore.
  4. Click Restore.
  5. Restart your application and ensure it uses the new target cluster.