Restoring the MongoDB Cluster

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 or db.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

  1. From the navigation pane, click Protect > Big data.

    The Instances page appears.

  2. In the Actions column for the MongoDB, click the action button action_button, and then click Restore.

    The Backup content page appears.

  3. Select the Replica Set that you want to restore, and then click Restore.

    The Restore dialog box appears.

  4. Complete one of the following tasks depending on the type of restore operation you are running:

    Restore operation

    Steps

    In-place

    1. Select the In place tab.

    2. 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

    1. Select the Out of place tab.

    2. In the Destination cluster list, select a different destination cluster where you want to restore the data.

    3. 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.

    4. In the Replica set details section, select the Client node and the dbpath directory where you want to restore the data.

    5. In the Port number box, enter a port number that that MongoDB server will connect to after recovery.

    Restore to disk

    1. Select the Restore to disk tab.

    2. In the Destination cluster list, select the same or destination cluster where you want to restore the data.

    3. 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.

    4. In the Replica set details section, select the Client node and dbpath directory where you want to restore the data.

  5. To get a notification email when the restore job completes, select the When the job completes, notify me via email check box.

  6. Click Submit.

What To Do Next

To add additional secondary nodes (if any) to the replication set, complete the following steps:

  1. 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.

  2. For sharded clusters, start the mongo routing service (mongos) on the required nodes:

mongos --config <path-to-config>

Loading...