Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.

Restore a Single Database

On this page

Overview

A backup snapshot contains a complete copy of the contents of your mongod dbpath. To restore a single collection or database or partial data, retrieve a backup snapshot and expand the snapshot data on a volume. Then use the mongodump and mongorestore commands to build and restore your data.

Procedure

Select and Download a Snapshot

1

Click the Backups tab and then Replica Set Status.

2

Click the name of the replica set that contains the database to restore.

MMS displays your selection’s stored snapshots.

3

Select the snapshot from which to restore.

To select a stored snapshot, click the Restore this snapshot link next to the snapshot.

To select a custom snapshot, click the Restore button at the top of the page. In the resulting page, select a snapshot as the starting point. Then select the Use Custom Point In Time checkbox and enter the point in time in the Date and Time fields. MMS includes all operations up to but not including the point in time. For example, if you select 12:00, the last operation in the restore is 11:59:59 or earlier. Click Next.

4

Select HTTP as the delivery method for the snapshot.

In the Delivery Method field, select Pull via Secure HTTP (HTTPS).

Optionally, you can instead choose SCP as the delivery method. If you choose SCP, you must provide the hostname and port of the server to receive the files and provide access to the server through a username and password or though an SSH key. Follow the instructions on the MMS screen.

5

Finalize the request.

Click Finalize Request and confirm your identify via two-factor verification. Then click Finalize Request again.

6

Retrieve the snapshot.

MMS creates a one-time link to a tar file of the snapshot. The link is available for one download and times out after an hour.

To download the snapshot, select the MMS Backup tab and then select Restore Jobs. When the restore job completes, select the download link next to the snapshot.

If you optionally chose SCP as the delivery method, the files are copied to the server directory you specfied. To verify that the files are complete, see the section on how to validate an SCP restore.

Restore the Database

1

Use the mongodump command to dump a single database.

Use the unpacked snapshot restore directory as the dpath switch and the single database name as the --db switch in the mongodump command:

mongodump --dbpath <path> --db <database-name>
2

Use the mongorestore command to import the single database dump.

Enter this mongorestore command:

mongorestore --db <database-name> --drop

You also may specify the --drop switch to drop all collections from the target database before you restore them from the bson file created with mongodump.