All Products
Search
Document Center

ApsaraDB for MongoDB:Download a backup file

Last Updated:Dec 03, 2025

You can back up your ApsaraDB for MongoDB data and download the backup files to your local machine for long-term storage. You can also restore the backup files to a self-managed database for purposes such as business testing or data analytics. This topic describes how to download a backup file.

Before you begin

  • No fees are charged for failed tasks.

  • You cannot cancel a backup download task after it starts.

  • You cannot use downloaded backup data to directly restore an ApsaraDB for MongoDB instance. To restore an instance, see Data restoration.

Billing

  • No fees are charged when you download backup files for local disk instances using a Public Connection String or a Private Connection String.

  • For cloud disk instances, downloading backups incurs fees for outbound internet traffic and backup set conversion.

    Traffic fees

    • Internal network download: Free of charge.

    • Internet download: Each instance comes with a free quota of 500 GB per month. You are charged for traffic that exceeds this quota on a pay-as-you-go basis. You can view the downloaded traffic volume on the Basic Information page of your MongoDB instance. For information about unit prices, see .

    • Billing point: Billing starts when the actual download begins after the background task is successful.

    • Cost savings: For large-volume downloads, you can purchase a subscription network plan to offset the costs.

    • Download to OSS: This incurs additional OSS fees. To avoid unnecessary storage costs, manually delete these files after you finish using them.

    Backup set conversion fees

    When you download a backup file for a cloud disk instance, you are charged for converting a snapshot backup into a BSON file. No free quota is provided.

    Region

    Conversion fee (USD/GB)

    Public cloud

    0.03125

    Note

    After you start a snapshot backup download for a cloud disk instance, the system creates a data conversion download task. No backup set conversion fees are charged if this task fails.

Download a backup for a cloud disk instance

Applicability

The MongoDB instance must meet the following requirements:

  • Service architecture: Replica set (excluding single-node) or sharded cluster.

  • Storage type: ESSD cloud disk.

  • Status: Running.

  • The instance is in one of the following regions (public cloud only): China (Chengdu), China (Guangzhou), China (Qingdao), China (Beijing), China (Shanghai), China (Zhangjiakou), China (Hangzhou), China (Shenzhen), China (Hong Kong), Malaysia (Kuala Lumpur), Indonesia (Jakarta), Japan (Tokyo), Singapore, Germany (Frankfurt), US (Silicon Valley), or US (Virginia).

  • The backup data is not encrypted.

  • If you use a Resource Access Management (RAM) user, the user must have permissions to download backup files.

    How do I grant permissions to a RAM user?

    1. Log on to the RAM console using your Alibaba Cloud account.

    2. In the navigation pane on the left, choose Permission Management > Policies.

    3. Click Create Policy, select the Script tab, enter the following policy content, and then click OK.

      {
        "Statement": [
          {
            "Effect": "Allow",
            "Action": "dds:Describe*",
            "Resource": "*"
          },
          {
            "Effect": "Allow",
            "Action": [
              "dbs:CreateDownload",
              "dbs:DescribeDBInstanceDownloadSize",
              "dbs:DescribeDownloadSupport"
            ],
            "Resource": "*"
          }
        ],
        "Version": "1"
      }
    4. In the Create Policy dialog box, enter a Name and Note for the policy. Confirm that the policy content is correct and click OK again.

    5. In the navigation pane on the left, choose Permission Management > Authorization.

    6. Click Grant Permission and grant the newly created policy to the RAM user. For more information, see Grant permissions to a RAM user on the Authorization page.

    7. Click OK.

Supported data for instance backup downloads

  • Unsupported:

    • The admin, local, or config system databases.

    • System tables that start with "system.".

    • Views or functions.

    • Time-series collections.

  • Supported: Collections (non-time-series) and index information.

Procedure

  1. Navigate to the backup list

    1. Go to the ApsaraDB for MongoDB replica set instances or sharded cluster instances list. Select a resource group and a region at the top of the page, and then click the ID of the target instance.

    2. In the navigation pane on the left of the instance details page, click Backup and Restoration.

    3. click Backup Download List.

  2. Start the download task: On the Backup Download List tab, click Download Instance Backup.

  3. Configure the download parameters

    1. In the Download Point-in-time and Backup Set step, select the required Backup Set and click Next.

    2. In the Download Instance, Database, and Table step, keep the default setting (Instance Download) and click Next.

    3. In the Download Destination and Format step, configure the download destination and format.

      Download Destination

      Configuration

      OSS (Recommended)

      1. Select Write data to your OSS.

      2. Enter the bucket name and folder prefix for the destination OSS.

        Only the Standard storage class for OSS is supported. To convert the storage class, see Convert storage class.

      3. Set Download Format to the default value BSON.

      4. If this is your first time using this feature, click Authorize > Agree to Authorization as prompted to grant ApsaraDB for MongoDB permissions to access OSS.

      URL

      1. Select URL.

      2. Select a download format.

      3. After the task is successful, you must manually generate a download link. The link is valid for a limited time.

  4. Confirm and execute Read and select the notice, and then click Complete. You are redirected to the Backup Download List tab, where you can monitor the task status.

  5. Obtain the backup file

    • OSS method: Wait for the task status to change to Successful. The file is automatically saved to the specified OSS bucket and folder.

    • URL method: Wait for the task status to change to Successful. The download task is valid for 3 days. During this period, click Generate Link in the Download Destination column. Set the validity period of the link, which can be from 5 minutes to 1 day. The default is 2 hours. You can then obtain the internal or external download URL. After the task and the link expire, the temporary data is automatically deleted. You must start a new download task to obtain the file.

    Important

    The download may fail if computing resources cannot be allocated due to contention on the service side. The download may also fail because of unsupported data formats. If a task fails, you can retry the download task or contact Data Disaster Recovery support.

  6. Download the file using a command-line tool

    After you obtain the download URL:

    • Use a command-line tool such as wget or curl to download the file (Recommended). For more information, see Appendix 1: Download commands in this topic.

    • For small files, you can copy the external download URL to the address bar of your browser.

Download a backup for a local disk instance

Applicability

  1. You can download backup files only for local disk instances that run MongoDB 4.2 or earlier.

  2. Backup file downloads are supported for only Physical Backups and Logical Backups, but not for Snapshot Backups. To download backup files for other instances, see What do I do if my instance does not support backup file downloads?.

Procedure

  1. Navigate to the backup list

    1. Go to the ApsaraDB for MongoDB replica set instances or sharded cluster instances list. Select a resource group and a region at the top of the page, and then click the ID of the target instance.

    2. In the navigation pane on the left of the instance details page, click Backup and Restoration.

  2. Start a download task

    1. On the Full Backup tab, find the target backup file and click Download in the Actions column.

    2. In the Download Backup dialog box that appears, Copy the Public Connection String or Private Connection String as required.

    3. Click OK.

  3. Download the file using a command-line tool

    After you obtain the download URL:

    • Use a command-line tool such as wget or curl to download the file (Recommended). For more information, see Appendix 1: Download commands in this topic.

    • For small files, you can copy the external download URL to the address bar of your browser.

Appendix 1: Download commands

Note

If you have a poor network connection, a timeout may occur when you download a file using the Public Connection String. We recommend that you take the following measures:

  • If your ECS instance and MongoDB instance are in the same region and both use the classic network or are in the same virtual private cloud (VPC), we recommend that you use the Private Connection String to download the backup file on the ECS instance.

  • Use a client that supports resumable downloads. For the Linux operating system, you can use the following wget command to download the backup file.

Download a backup file on Windows or macOS

Paste the download URL of the backup file into the address bar of your browser and press Enter. The browser automatically downloads the backup file.

Download a backup file on Linux

Run the following command to download the backup file.

wget -c '<Backup_file_download_URL>' -O <Custom_file_name><File_name_extension>

Parameter description:

  • -c: Enables resumable download mode.

  • -O: Saves the downloaded content to a file with a specified name.

  • <File_name_extension>: The extension is typically _qp.xb or .tar.gz. Ensure that the extension is the same as the one in the download URL.

Example:

wget -c 'http://rdsbak-hz-v3.oss-cn-hangzhou-internal.aliyuncs.com/custins5475****/hins1907****_data_20210906103710_qp.xb?Expires=......' -O backupfile._qp.xb

FAQ

What do I do if my instance does not support backup file downloads?

If your instance does not support backup file downloads, follow these instructions based on your objective:

  • Restore data to a new ApsaraDB for MongoDB instance: You do not need to download the backup file to restore data to a new ApsaraDB for MongoDB instance. For more information, see Restore data to an ApsaraDB for MongoDB instance.

  • Restore data to a self-managed database or another ApsaraDB for MongoDB instance: To restore data to a self-managed database or migrate data to another ApsaraDB for MongoDB instance, you can use Data Transmission Service (DTS) for migration. For more information, see Migration solutions for self-managed MongoDB databases or ApsaraDB for MongoDB instances.

  • Export data for long-term storage: If you only need to export data for long-term storage, you can use the mongodump tool. For more information, see mongodump.

The backup file is too large and the download takes a long time. What if the download is interrupted?

On Linux, you can add the -t 0 parameter with the -c parameter to the wget command. This allows wget to retry the connection indefinitely if the download is interrupted. On Windows and macOS, if a download is interrupted, you can typically resume it from the download management page in your browser.

What do I do if a "403: Forbidden" error is reported when I download a backup?

Check whether the download command is correct. Ensure that the download URL is enclosed in single quotation marks (').