All Products
Search
Document Center

ApsaraDB for MongoDB:Download a backup file

Last Updated:Nov 06, 2025

You can download ApsaraDB for MongoDB backup files for long-term local storage. You can also restore 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

  • You are not charged for failed tasks.

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

  • You cannot use a downloaded backup file to directly restore an ApsaraDB for MongoDB instance. For more information about how to restore an instance, see Data restoration.

Billing

  • Downloading backup files from local disk instances using a Public Connection String or a Private Connection String is free of charge.

  • If you download a backup file from a cloud disk instance, you are charged for outbound traffic and backup set conversion.

    Traffic fees

    • Internal network downloads: Free of charge.

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

    • Billing point: Billing starts when the download begins after the background task succeeds.

    • Cost savings: To save on costs for large traffic downloads, you can purchase a subscription network plan.

    • Download to OSS: This action incurs additional OSS fees. To avoid unnecessary storage costs, manually delete these files after you confirm they are no longer needed.

    Backup set conversion fee

    When you download a backup file from a cloud disk instance, you are charged a fee for converting the snapshot backup to a BSON file. No free quota is provided. The billing standards are as follows:

    Region

    Conversion fee (USD/GB)

    Public Cloud

    0.03125

    Note

    When you initiate a snapshot backup download for a cloud disk instance, the system creates a data conversion download task. You are not charged a backup set conversion fee if this task fails.

Download a backup file from a cloud disk instance

Scope

Your MongoDB instance must meet all the following conditions:

  • Service architecture: Replica set (excluding single-node instances) 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, or Germany (Frankfurt).

  • The backup data is not encrypted.

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

    How do I grant permissions to a RAM user?

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

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

    3. Click Create Access Policy, select Script Editor, 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 Access Policy dialog box, enter a Name and Note for the policy. Confirm that the policy content is correct, and then click OK again.

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

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

    7. Click Confirm Grant Permission.

Supported data

  • The following items are not supported:

    • The admin, local, and config system databases.

    • System tables that start with "system.".

    • Views and functions.

    • Time-series collections.

  • The following items are supported: non-time-series collections and index information.

Procedure

  1. Go to the backup list

    1. Go to the ApsaraDB for MongoDB replica set instances page or the ApsaraDB for MongoDB sharded cluster instances page. In the upper-left corner of the page, select a resource group and a region. 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. On the Backup Download List tab, click Instance Backup Download.

  2. Initiate a download taskOn the Backup Download tab, click Instance Backup Download.

  3. Configure instance backup download parameters

    1. In the Download Time Point and Backup Set step, select a Backup Set to download, and then click Next.

    2. In the Download Instance and Database/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 directory prefix of the destination OSS.

        Only the Standard storage class for OSS is supported. To change the storage class, see Change the storage class.

      3. Set Download Format to BSON, which is the default value.

      4. If this is your first time using this feature, follow the prompts to click Go to Authorization > Agree to Authorization 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 executeRead and select the checkbox to agree to the terms, and then click Finish. 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 automatically appears in the specified OSS bucket and directory.

    • URL method: Wait for the task status to change to Successful. Within the validity period of 3 days, click Generate Link in the Download Destination column. Set the link validity period (5 minutes to 1 day, default: 2 hours) to obtain the internal or external download URL. After the task and the link expire, the temporary data is automatically cleared. You must then initiate a new download task.

    Important

    A download may fail because of a temporary resource allocation failure or an unsupported data format. If a task fails, you can retry the download or contact Data Disaster Recovery technical support.

  6. Use a command-line tool to download the file

    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 paste the external download URL directly into your browser's address bar.

Download a backup file from a local disk instance

Applicability

  1. Only local disk instances of ApsaraDB for MongoDB 4.2 and earlier support downloading backup files.

  2. Only Physical Backups and Logical Backups can be downloaded. Snapshot Backups cannot be downloaded. For information about how to download backup files from other instances, see What do I do if my instance does not support backup file downloads?.

Procedure

  1. Go to the backup list

    1. Go to the ApsaraDB for MongoDB replica set instances page or the ApsaraDB for MongoDB sharded cluster instances page. In the upper-left corner of the page, select a resource group and a region. 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. Initiate 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, Copy and record the Public Connection String or Private Connection String as needed.

    3. Click OK.

  3. Use a command-line tool to download the file

    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 paste the external download URL directly into your browser's address bar.

Appendix 1: Download commands

Note

If you have a poor network connection, a timeout may occur when you download from a 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) (with the same VPC ID), we recommend that you download the backup file on the ECS instance using a Private Connection String.

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

Download a backup file on a Windows or macOS system

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

Download a backup file on a Linux system

Run the following command to download the backup file.

wget -c '<Backup_File_Download_URL>' -O <Custom_File_Name><Suffix>

Parameter description:

  • -c: Enables resumable download mode.

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

  • <Suffix>: Usually _qp.xb or .tar.gz. Make sure it matches the file suffix 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 downloading backup files, use one of the following methods based on your objective:

The backup file is too large. What if the download is interrupted?

On Linux, you can add the -t 0 parameter to the wget command along with the -c parameter. If the download is interrupted, wget retries the connection indefinitely. On Windows and macOS, you can usually resume the download from the browser's download management page.

What do I do if a "403: Forbidden" error occurs during download?

Check if the download command is correct. Enclose the download URL in single quotation marks.