Download Backup File

Last updated: 2020-09-01 18:02:53


    To download backups via a sub-account, please grant the sub-account sufficient permissions. For more information, please see Sub-Account Authorization for Backup Download.

    1. Log in to the TencentDB for MongoDB Console and click an instance name in the instance list to enter the instance management page.
    2. On the Backup and Rollback > Backup List page, click Download to get the region code, bucket, and download link that are required for backup download.

    Configuring COSCMD

    1. Log in to the CAM Console and get the SecretId and SecretKey on the API Key Management page.
    2. Download the COSCMD tool that is required for downloading TencentDB for MongoDB backup files.
    3. Configure COSCMD as instructed in Configuring Parameters.
      For example, if the obtained SecretId is IKIDxxxxxxxxxxx20Eb, SecretKey is TbecxxxxxxxxxxxT4Yw, region code is ap-guangzhou, and bucket is mognodb-backup-test-1251937, then the configuration of COSCMD will be as shown below:
      coscmd config -a IKIDxxxxxxxxxxx20Eb -s TbecxxxxxxxxxxxT4Yw -b mognodb-backup-test-1251937 -r ap-guangzhou

    Downloading Backup File

    1. Log in to the Linux CVM instance and specify an empty download directory. If there is no empty directory, run the following command to create one:

      mkdir dump


      The private network address of the Linux CVM instance must be within one of the following IP ranges; otherwise, backup files cannot be downloaded.

    2. Run the download command with the download link obtained from the TencentDB for MongoDB Console. For example, if the download link is cmongo_backup/cmgo-pfsumk5l_0/snapshot/1544517026, the command will be as shown below:

      coscmd  download -r  cmongo_backup/cmgo-pfsumk5l_0/snapshot/1544517026  dump/
      • A replica set has only one download link.
      • Each shard of a sharded cluster has a download link. Different shards need to be stored in different directories so as to prevent the downloaded data from being overwritten.
      • -r must be added to the command for downloading folders.
    3. After the download is completed, you can view the downloaded files as shown below:

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback