> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Restore Overview

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

You can restore a single MongoDB database, a [replica set](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-replica-set), or all shards in a [sharded cluster.](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-sharded-cluster)

You can restore a deployment from an existing [snapshot](https://www.mongodb.com/docs/ops-manager/current/reference/glossary.md#std-term-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.](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-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 (MongoDB Backup Restore Utility) requests and applies [oplog](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-oplog) entries between the latest complete snapshot and the point in time you choose.

To restore your backup, use one of these options:

- [Restore the files to another cluster using automation](https://www.mongodb.com/docs/ops-manager/current/tutorial/nav/restore-overview.md#std-label-mms-automated-restore)

- [Manually copy restored files to the hosts you choose](https://www.mongodb.com/docs/ops-manager/current/tutorial/nav/restore-overview.md#std-label-mms-manual-restore)

- [Restore from a queryable backup](https://www.mongodb.com/docs/ops-manager/current/tutorial/restore-single-database.md)

## Cancel a Restore

To cancel a restore:

1. Navigate to the Backup > Restore History tab.

2. Click Cancel.

## Automated Restore

If you choose to have Ops 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.](https://www.mongodb.com/docs/ops-manager/current/reference/glossary.md#std-term-snapshot)

### Limitations

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.

### Prerequisites

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](https://www.mongodb.com/docs/ops-manager/current/reference/user-roles.md#std-label-backup-admin-role) and [Automation Admin](https://www.mongodb.com/docs/ops-manager/current/reference/user-roles.md#std-label-automation-admin-role) roles in Ops Manager.

- Ensure that the source and target clusters have the same number of shards. Ops Manager excludes clusters with a different number of shards from the available restore targets.

- 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:

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

  To learn more, see [`setFeatureCompatibilityVersion`.](https://www.mongodb.com/docs/manual/reference/command/setFeatureCompatibilityVersion.md#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion)

- Review the following compatibility matrix for the supported source cluster for each MongoDB version. The MongoDB version of each host in the target cluster *must* support the FCV (Feature Compatibility Version) of the snapshot of the source cluster.

  | Source Cluster FCV (Feature Compatibility Version) | MongoDB4.4 | MongoDB5.0 | MongoDB6.0 | MongoDB7.0 | MongoDB8.0 |
  | --- | --- | --- | --- | --- | --- |
  | 4.4 |  |  |  |  |  |
  | 5.0 |  |  |  |  |  |
  | 6.0 |  |  |  |  |  |
  | 7.0 |  |  |  |  |  |
  | 8.0 |  |  |  |  |  |

### Restore to Different Project

You can choose to restore to a cluster of a different project in the same or different organization.

To restore to another Ops Manager project, you must have [Project Owner](https://www.mongodb.com/docs/ops-manager/current/reference/user-roles.md#std-label-project-roles), [Automation Admin](https://www.mongodb.com/docs/ops-manager/current/reference/user-roles.md#std-label-automation-admin-role), or [Backup Admin](https://www.mongodb.com/docs/ops-manager/current/reference/user-roles.md#std-label-backup-admin-role) roles for the target project.

**Note:**

If the source cluster uses [encryption at rest](https://www.mongodb.com/docs/ops-manager/current/tutorial/encrypt-snapshots.md#std-label-encrypt-snapshots) with a KMIP server, configure the target cluster to use the same KMIP server. If the KMIP server is unavailable on the target cluster, MongoDB fails to start after the restore.

### Potential Causes for Automated Restore Failure

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

- [`storage.engine`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-storage.engine)

- [`storage.directoryPerDB`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-storage.directoryPerDB)

- `storage.mmapv1.nsSize`

- `storage.mmapv1.smallFiles`

- [`storage.wiredTiger.collectionConfig.blockCompressor`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-storage.wiredTiger.collectionConfig.blockCompressor)

- [`storage.wiredTiger.engineConfig.directoryForIndexes`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-storage.wiredTiger.engineConfig.directoryForIndexes)

No method exists to check for mismatches before attempting a restore. If a restore attempt fails, Ops 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](https://www.mongodb.com/docs/ops-manager/current/tutorial/edit-deployment.md) to change your storage engine to [WiredTiger Storage Engine](https://www.mongodb.com/docs/manual/core/wiredtiger.md#std-label-storage-wiredtiger), Ops 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.

### Restore Procedures

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

- [Replica Set](https://www.mongodb.com/docs/ops-manager/current/tutorial/restore-replica-set.md#std-label-automatic-restore-replica-set)

- [Sharded Cluster](https://www.mongodb.com/docs/ops-manager/current/tutorial/restore-sharded-cluster.md#std-label-automatic-restore-sharded-cluster)

## Manual Restore

### Prerequisites

To perform manual restores, you must have the [Backup Admin](https://www.mongodb.com/docs/ops-manager/current/reference/user-roles.md#std-label-backup-admin-role) role in Ops Manager.

### Restore File Format

Ops Manager provides each [snapshot](https://www.mongodb.com/docs/ops-manager/current/reference/glossary.md#std-term-snapshot) as an uncompressed (`.tar`) or compressed (`.tar.gz`) archive containing a copy of your database files.

Choosing compressed [snapshots](https://www.mongodb.com/docs/ops-manager/current/reference/glossary.md#std-term-snapshot) results in faster delivery, but requires sufficient space on the target host for both the compressed snapshot and its extracted database files.

- For a [replica set](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-replica-set), Ops Manager provides one [snapshot](https://www.mongodb.com/docs/ops-manager/current/reference/glossary.md#std-term-snapshot) that you copy to each replica set member.

- For a sharded cluster, Ops Manager provides one [snapshot](https://www.mongodb.com/docs/ops-manager/current/reference/glossary.md#std-term-snapshot) for the [config servers](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-config-server) and one [snapshot](https://www.mongodb.com/docs/ops-manager/current/reference/glossary.md#std-term-snapshot) for each [shard.](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-shard)

### Manual Restore Procedures

To perform a manual restore, see:

- [Restore a Single Database or Collection using Queryable Backup](https://www.mongodb.com/docs/ops-manager/current/tutorial/restore-single-database.md)

- [Restore a Replica Set](https://www.mongodb.com/docs/ops-manager/current/tutorial/restore-replica-set.md#std-label-manual-restore-replica-set)

- [Restore a Sharded Cluster](https://www.mongodb.com/docs/ops-manager/current/tutorial/restore-sharded-cluster.md#std-label-manual-restore-sharded-cluster)

### Restore Process Flows

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