You can browse and restore the backed up replica sets for a MongoDB cluster to the same or a different cluster.
Before You Begin
Review the following requirements:
-
If you have scheduled operation log dump backups, disable the operation log dump backups. See Disabling Operation Log Dump Backups.
-
In case of a Sharded cluster deployment, stop the mongos service.
Use
db.shutdownServer()
to ensure a clean shutdown. -
Stop the mongod service on all the nodes of all the replication sets, including the config server replication set.
Use
--shutdown
ordb.shutdownServer()
to ensure a clean shut down -
Clear the data directory paths on all the nodes.
-
Before cleanup, make a copy of the MongoDB configuration file, especially if the file is in the dbpath directory. The configuration file is required to start the server after the restore operation.
-
During recovery, the MongoDB log file is created in the /var/log/mongodb directory if the directory exists. Otherwise, the MongoDB log file is created in the /var/log directory. Verify that the operating system user has permissions on this directory to create the log file.
-
The destination shard configuration must match the source shard configuration.
-
The destination must have the same or higher version of MongoDB than the source.
Procedure
-
From the navigation pane, click Protect > Big data.
The Instances page appears.
-
In the Actions column for the MongoDB, click the action button , and then click Restore.
The Backup content page appears.
-
Select the Replica Set that you want to restore, and then click Restore.
The Restore dialog box appears.
-
Complete one of the following tasks depending on the type of restore operation you are running:
Restore operation
Steps
In-place
-
Select the In place tab.
-
Optional: In the Staging path for oplog restore box, browse or type the destination path where you want to restore the oplogs. By default, the oplog backups, if any, are restored to the job results directory of the MongoDB agent.
Out-of-place
-
Select the Out of place tab.
-
In the Destination cluster list, select a different destination cluster where you want to restore the data.
-
Optional: In the Staging path for oplog restore box, browse or type the destination path where you want to restore the oplogs. By default, the oplog backups, if any, are restored to the job results directory of the MongoDB agent.
-
In the Replica set details section, select the Client node and the dbpath directory where you want to restore the data.
-
In the Port number box, enter a port number that that MongoDB server will connect to after recovery.
Restore to disk
-
Select the Restore to disk tab.
-
In the Destination cluster list, select the same or destination cluster where you want to restore the data.
-
Optional: In the Staging path for oplog restore box, browse or type the destination path where you want to restore the oplogs. By default, the oplog backups, if any, are restored to the job results directory of the MongoDB agent.
-
In the Replica set details section, select the Client node and dbpath directory where you want to restore the data.
-
-
To get a notification email when the restore job completes, select the When the job completes, notify me via email check box.
-
Click Submit.
What To Do Next
To add additional secondary nodes (if any) to the replication set, complete the following steps:
-
Connect a mongo shell to the restored mongod instance,and then run the following command:
rs.add("hostname:port")
This command will synchronize the member with the data on the primary node.
-
For sharded clusters, start the mongo routing service (mongos) on the required nodes:
mongos --config <path-to-config>