百度智能云

All Product Document

          Cloud Database MONGODB

          Restore Logic Backup to Selt-built Database

          Users can perform the full logical backup of replica cluster instances and download logical backup files through the console. After the download is complete, you can restore the data to the self-built MongoDB database through the mongorestore tool.

          Prerequisites

          The instance type is the replica cluster instance.

          Operating Steps

          1. Log in to MongoDB Management Console.
          2. In the upper left corner of the page, select the region where the instance resides.
          3. In the left navigation bar, click Replica Cluster Instance List.
          4. Find the target instance, and click the instance ID to enter the instance feature page.
          5. Click Backup on the left navbar.
          6. Click the Manual backup button and select the Logic backup.

          image.png

          1. After completing the above parameter configuration, click OK and wait a while to complete the backup.
          2. On the backup list page, select the target backup record and click the download option on the right. The download pop-up window is shown below:

          image.png

          1. Copy the downloaded backup file to the environment where the mongorestore tool is installed.
          2. Execute the following command to import the data into the self-built database.
          mongorestore -h <host> --port <port> -u <username> -p <password> --drop --oplogReplay --gzip --archive=<backupfile> -vvvv --stopOnError

          Descriptions:

          • host: The server address to which the self-built database belongs. You can enter 127.0.0.1 for the local machine.
          • port: The database port of the self-built database.
          • username: The database user name for logging in to the self-built database.
          • password: The database password for logging in to the self-built database.
          • backupfile: The name of the downloaded logic backup file.
          Previous
          Create Instance from Backup Point
          Next
          Restore Physical Backup to Self-built Database