For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Restore Overview

To restore a deployment from a backup, select a snapshot or point in time from which you want to restore your database. Cloud Manager provides you with the files from which you can restore your database.

You can restore a single MongoDB database, a replica set, or all shards in a sharded cluster.

You can restore a deployment from an existing snapshot or a specific point in time. For the point in time, you can specify a date and time, an oplog timestamp, or a checkpoint for a sharded cluster.

If you are restoring from a point in time, you must download the MongoDB Backup Restore Utility to your target host. The MBRU requests and applies oplog entries between the latest complete snapshot and the point in time you choose.

To restore your backup, use one of these options:

When you perform a point-in-time restore, Cloud Manager shows only the time ranges to which you can safely restore. Use the following information to understand why certain times may not be available.

When you request a point-in-time restore, the restore dialog shows the restorable time ranges for the selected deployment. These ranges represent the periods for which Cloud Manager has a complete and continuous oplog history. You can only choose a restore time that falls within one of these ranges.

Oplog gaps can occur in the following situations:

  • The oplog tailing stops because of an issue with a backup job tailing the oplog, and the oplog rolls over before MongoDB Agent tails it again.

  • A topology change occurs, until Cloud Manager completes a new snapshot.

  • A FCV change occurs, until Cloud Manager completes a new snapshot. You cannot apply a point-in-time restore across MongoDB version changes.

  • A restore completes, until Cloud Manager completes a new snapshot.

If the restore time you need is not available in the dialog, investigate recent topology or FCV changes and review backup job history to understand why that period is not restorable.

For example, the restore dialog might show these restorable time ranges:

  • June 8th 13:45:03 to June 8th 17:45:03

  • June 8th 19:45:03 to June 9th 07:45:03

In this case, you cannot restore to any time between June 8th 17:45:03 and June 8th 19:45:03 because an oplog gap exists for that period.

To cancel a restore:

  1. Navigate to the Backup > Restore History tab.

  2. Click Cancel.

If you choose to have Cloud Manager automation restore your backup, the Automation removes all existing data from the target hosts and replaces that data with new backup data from your snapshot.

If you are restoring a sharded cluster, you must restore all shards. The restore process fails if you try to restore a single shard in a sharded cluster.

To perform automated restores:

  • Install an MongoDB Agent installed on the source and all target hosts, and check that an MongoDB Agent on the target deployment can connect to all hosts in the target deployment.

  • Configure Backup Admin and Automation Admin roles in Cloud Manager.

  • For sharded clusters running FCV 4.0 or earlier, enable checkpoints.

  • Check that the target cluster's featureCompatibilityVersion is greater than or equal to the source cluster's featureCompatibilityVersion.

    Example

    Run the following command to retrieve the featureCompatibilityVersion of a given host:

    db.adminCommand( {
    getParameter: 1,
    featureCompatibilityVersion: 1
    } )

    To learn more, see setFeatureCompatibilityVersion.

  • Review the following compatibility matrix for the supported source cluster FCV of each MongoDB version. The MongoDB version of each host in the target cluster must support the FCV of the snapshot of the source cluster.

Source Cluster FCV
MongoDB
4.0
MongoDB
4.2
MongoDB
4.4
MongoDB
5.0
MongoDB
6.0

4.2

4.4

5.0

6.0

You can choose to restore to a cluster of a different project:

  • To restore to another Cloud Manager project, you must have Automation Admin or Backup Admin roles for the target project.

  • To restore to another MongoDB Atlas project, you must have Project Owner role for the target project.

An automated restore can fail when certain storage settings of the backup's database and target database do not match:

No method exists to check for mismatches before attempting a restore. If a restore attempt fails, Cloud Manager displays any mismatched settings. If you still want to restore the backup's database, fix the settings in the target database that do not match backup's database, then retry the restore process for the backup's database.

Important

MongoDB removed support for the MMAPv1 storage engine in MongoDB 4.2. If you edit your deployment's configuration to change your storage engine to WiredTiger Storage Engine, Cloud Manager restarts the MongoDB processes.

An automated restore fails when you attempt to restore a single shard in a sharded cluster. If you are restoring a sharded cluster, you must restore all shards.

To perform an automated restore, see the procedure for the deployment you want to restore:

To perform manual restores, you must have the Backup Admin role in Cloud Manager.

Cloud Manager provides each snapshot as an uncompressed (.tar) archive containing a complete copy of the data directory.

To perform a manual restore, see:

You can restore from a completed snapshot or from a specific point in time. Use the following pages to learn about the manual restore process flows.