Downloading Backup File

Last updated: 2020-12-17 17:52:00

    This document describes how to download backup files of TencentDB for MongoDB through the console and CVM.


    To download backups with a sub-account, you need to authorize it first. For more information, please see Sub-Account Authorization for Backup Download.

    1. Log in to the TencentDB for MongoDB console, click an instance name/ID in the instance list, and 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.

    Step 2. Configure COSCMD

    1. Log in to the CAM console and get the SecretId and SecretKey on the Manage API Key page.
    2. Download the COSCMD tool that is required for downloading TencentDB for MongoDB backup files.
    3. Configure COSCMD as instructed in COSCMD > 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

    Step 3. Download backup files

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


      The private IP of the Linux CVM instance must be within any 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