Navigation
  • Restoration >
  • Restore a Cluster from a Cloud Provider Snapshot

Restore a Cluster from a Cloud Provider Snapshot

Feature unavailable in Free and Shared-Tier Clusters

This feature is not available for M0 (Free Tier), M2, and M5 clusters. To learn more about which features are unavailable, see Atlas M0 (Free Tier), M2, and M5 Limitations.

Atlas lets you restore data from a scheduled cloud provider snapshot. For information on cloud provider snapshot backups, see Cloud Provider Snapshots.

For instructions on restoring data from a continuous backup snapshot, see Restore a Cluster from a Continuous Backup Snapshot or Point in Time.

Restore Restrictions

  • Atlas can only restore to a replica set or sharded cluster that uses the same encryption provider as the source snapshot cluster.
  • The target cluster must run the same or newer release version of MongoDB as the snapshot MongoDB version.

Prerequisites

Stop Client Operations during Restoration

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.

Procedure

Restoring Snapshots for Clusters using Encryption at Rest

Atlas automatically encrypts Cloud Provider Snapshots for clusters using Encryption at Rest using Customer Key Management, in addition to the existing encryption applied to all Atlas storage and snapshot volumes. For documentation on restoring an encrypted snapshot, see Restore a Snapshot of a Cluster with Encryption at Rest

The following instructions only apply to snapshots for clusters not using Encryption at Rest.

  1. From the Clusters view, click on the cluster name.

  2. Click the Backup tab.

    If the cluster has no Backup tab, then Atlas backups are disabled for that cluster and no snapshots are available. You can enable backups when scaling the cluster.

  3. Select a cluster’s snapshot to restore.

    Click Restore or Download.

  4. Follow the prompts to restore your cluster. You may choose to:

Download your Snapshot via HTTPS

From the Snapshots tab, click Download to retrieve your backup data via HTTPS and restore manually. Atlas generates a one-time use download link that expires within 4 hours. Once the download is ready, Atlas emails you a link to download the snapshot. Atlas also displays the download link in the Restore History tab.

You must add the IP or CIDR address of the client to your Atlas project whitelist. The Restore prompt displays your Existing IP Whitelist.

If the current project whitelist ranges do not cover the target client IP or CIDR address, click Add or Modify your IP Addresses to make changes to your Atlas project whitelist.

Atlas compresses the snapshot into a .tar.gz file. Use your preferred archive utility to extract the archive and access the data files. The following example uses the tar utility to extract a tar archive with gzip compression:

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

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

Invoke the following command to start the mongod instance using the extracted data file directory:

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

Note

You cannot choose to download your backup if there is already an active download available. To view the active download, click the Restore History tab.

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. Click Restore in the Actions column for the snapshot you want to restore.
  2. From the Restore dialog, select the target cluster to which you want to restore.
  3. Click Restore.
  4. Restart your application and ensure it uses the new target cluster.

Restore your Snapshot to a Cloud Manager Project

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.

  1. Click Restore in the Actions column for the snapshot you want to restore.
  2. From the Restore dialog, select the target Cloud Manager project to which you want to restore.
  3. Click Restore.
  4. Restart your application and ensure it uses the new target cluster.

Cloud Manager can only restore to a replica set cluster sharded cluster. The target cluster must run the same or newer version of MongoDB as the snapshot MongoDB version.

You can restore to any Cloud Manager project for which the authenticated Atlas user has any of the following roles:

You must add the IP or CIDR addresses of the target Cloud Manager project to your Atlas project whitelist. The Restore prompt displays your Existing IP Whitelist.

If the current project whitelist ranges do not cover the target Cloud Manager project IP or CIDR addresses, click Add or Modify your IP Addresses to make changes to your Atlas project whitelist.

Restore a Snapshot of a Cluster with Encryption at Rest

Important

Snapshots of clusters using Encryption at Rest using your Key Management can only restore to other clusters that use Encryption at Rest. You cannot restore a snapshot with Encryption at Rest to a Cloud Manager project, nor can you download the snapshot.

If the target project does not have a cluster with Encryption at Rest enabled, you can either deploy a cluster with Encryption at Rest, or enable Encryption at Rest in an existing cluster.

  1. From the Clusters view, click on the cluster name.

  2. Click the Backup tab.

    If the cluster has no Backup tab, then Atlas backups are disabled for that cluster and no snapshots are available. You can enable backups when scaling the cluster.

  3. Click Restore in the Actions column for the snapshot you want to restore.

  4. From the Restore dialog, select the target Atlas Project to which you want to restore. You can restore to any Atlas project for which the authenticated Atlas user has the Project Owner role.

  5. Select the Cluster to restore to. You can only restore to an Atlas replica set running Encryption at Rest. The target cluster must run the same or greater version of MongoDB as the MongoDB Version of the snapshot.

    After the restoration procedure, Atlas triggers a key rotation for MongoDB encryption key. Atlas then encrypts the new MongoDB encryption keys based on the configured Encryption at Rest provider for the target cluster.

  6. Restart your application and ensure it uses the new target cluster.

Troubleshooting Encryption at Rest

If Atlas has an issue with the encryption of either the snapshot or the target cluster, it displays one of the following errors:

Error Result
Cannot restore a non-encrypted snapshot to a cluster with Encryption at Rest enabled. The snapshot cannot be restored to Atlas.
Target cluster does not have encryption enabled. You can either deploy a new target cluster with Encryption at Rest, or enable Encryption at Rest on your desired target cluster.
Encryption provider of target cluster does not match selected snapshot’s encryption provider.

The encryption provider for the snapshot and target cluster do not match. You can either:

  1. Create a new snapshot with the same encryption provider.
  2. Change the encryption provider for the target cluster.
Encryption credentials on snapshot are not present. Atlas cannot restore a snapshot whose encryption key was deleted.

View Status of Snapshot Restorations

Atlas provides a detailed list of completed and in-progress snapshot restorations, including when Atlas took the snapshot and the snapshot’s delivery type. To view this list, from a cluster’s Backup tab, click the Restore History tab.

The Status column of the table displays the results of completed snapshots, and the progress of snapshots currently being restored.

  • For manually downloaded snapshots, the Status column displays progress while Atlas prepares the download link. Once the download is ready, the column displays the link to download the snapshot.
  • For automated restores, the Status column updates as the restoration progresses on each node in the cluster. When the restoration completes, the column displays the time of completion and the cluster to which Atlas restored the snapshot.