All Products
Search
Document Center

ApsaraDB for MongoDB:Download backup files

Last Updated:Apr 07, 2026

Download ApsaraDB for MongoDB backup files to a local machine for long-term storage, business testing, or data analytics. You can also restore downloaded files to a self-managed MongoDB database.

Precautions

  • You can run only one download task at a time for each instance. If a previous task is still running or has failed, you cannot start a new task.

  • You cannot cancel a download task after it starts.

  • You cannot directly restore an ApsaraDB for MongoDB instance from downloaded backup files. To restore an instance, see Data restoration.

  • Failed tasks do not incur fees.

Billing

Billing rules depend on the storage type of your instance: cloud disk or local disk.

  • You are not charged for downloads over public or private connection strings.

  • For cloud disk instances, you are charged for outbound internet traffic and backup set conversion.

    Traffic fees

    • Internal network download: Free of charge.

    • Internet download: Each instance has a free quota of 500 GB per month. Traffic exceeding this quota is billed on a pay-as-you-go basis.

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

    • Cost savings: For large-volume downloads, purchase a subscription network plan to reduce traffic costs.

    • Download to OSS: If you download to Object Storage Service (OSS), additional OSS fees apply. Delete the backup files from OSS when you no longer need them to avoid unnecessary storage costs.

    Backup set conversion fees

    For Cloud Disk instances, a fee is charged for converting snapshot backups to BSON files when using the "download backup file" feature. No free quota is available. The billing standard is as follows:

    Region

    Conversion fee (USD/GB)

    Public cloud

    0.03125

Download backups for cloud disk instances

This section describes how to download backup files for ApsaraDB for MongoDB cloud disk instances. You can download these files to an Object Storage Service (OSS) bucket or obtain a download URL.

Applicability

Your instance must meet all of the following requirements:

Requirement

Details

Architecture

Replica set (excluding single-node instances) or sharded cluster.

Storage type

ESSD cloud disk.

Instance status

Running.

Backup encryption

Backup data must not be encrypted.

Region

Public cloud only. Supported regions: 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), and US (Virginia).

RAM user permissions

If you use a RAM user, the user must have the required permissions.

Supported and unsupported data

Supported: Non-time-series collections and index information.

Not supported:

  • The admin, local, and config system databases.

  • System collections with names starting with system..

  • Views and functions.

  • Time-series collections.

  • Database or collection names containing a forward slash (/) — the task fails if any are present.

Grant permissions to a RAM user

If you use a RAM User account, attach a custom policy with the following permissions before starting a download task.

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

  2. In the left-side navigation pane, choose Permissions > Policies.

  3. Click Create Policy. On the JSON Editor 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 the policy content and click OK.

  5. In the left-side navigation pane, choose Permissions > Grants.

  6. Click Grant Permission and attach the policy to the RAM user. For details, see Grant permissions to a RAM user on the Authorization page.

  7. Click OK.

Start a download task

  1. Go to the ApsaraDB for MongoDB replica set instances or sharded cluster instances page. In the upper-left corner, select the region and resource group, and then click the target instance ID.

  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup Download List tab, click Download Instance Backup File.

  4. In the 1 Point in Time and Backup Set step, select a Backup Set and click Next.

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

  6. In the 3 Destination and Format step, choose a download destination.

    Destination

    Steps

    OSS (Recommended)

    1. Select OSS.

    2. Enter the destination OSS bucket name and directory prefix. Only the Standard storage class is supported. To change the storage class of an existing bucket, see Change the storage class.

    3. For Download Format, keep the default value BSON.

    4. If this is your first time using this feature, click Authorize and then Agree to Authorization to grant ApsaraDB for MongoDB access to OSS.

    URL

    1. Select URL.

    2. Select the download format.

    3. After the task succeeds, manually generate a download link. The link is valid for a limited period.

  7. Read and accept the terms, then click Complete. You are redirected to the Backup Download List tab, where you can monitor the task status.

Retrieve the backup file

OSS method: When the task status becomes Successful, the backup file automatically appears in the specified OSS bucket and directory.

URL method: When the task status becomes Successful, you have 3 days to click Generate Link in the Download Target column. Set a validity period from 5 minutes to 1 day (default: 2 hours). The system then provides an internal or public download URL.

Important

The system automatically deletes temporary data when the link expires or after 3 days if no link is generated. To retrieve the file after this point, you must start a new download task.

Downloads can fail due to temporary resource allocation issues or unsupported data. If a task fails, retry it or contact technical support.

Once you have the download URL, use wget or curl to download the file. See Download commands.

Download backups for local disk instances

This procedure applies to local disk instances running MongoDB 4.2 or earlier. Physical backups and logical backups are supported. Snapshot backups are not supported.

If your instance does not meet these requirements, see What to do if your instance doesn't support backup downloads.

Start a download task

  1. Go to the ApsaraDB for MongoDB replica set instances or sharded cluster instances page. In the upper-left corner, select the region and resource group, and then click the target instance ID.

  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Full Backup tab, find the backup file you want to download and click Download in the Actions column.

  4. In the Download Backup dialog box, copy the Public Connection String or Private Connection String.

  5. Click OK.

Once you have the download URL, use wget or curl to download the file. See Download commands.

Download commands

If you have a poor network connection, downloading with the Public Connection String may time out. To avoid this, use the Private Connection String if your Elastic Compute Service (ECS) instance and ApsaraDB for MongoDB instance are in the same region and connected via the classic network or the same virtual private cloud (VPC).

Download on Windows or macOS

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

Download on Linux

Run the following command:

wget -c '<backup-file-download-url>' -O <custom-filename>.<extension>

Parameter

Description

-c

Enables resumable download mode.

-O <custom-filename>.<extension>

Saves the file with the specified name. The original backup filename may exceed the character limit of some file systems — use -O to rename it. The extension is typically _qp.xb or .tar.gz. Use the same extension as the one in the download URL.

Enclose the download URL in single quotation marks ('). If the URL contains special characters and is not quoted, the shell misinterprets the URL and the download fails.

Example:

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

FAQ

What to do if your instance doesn't support backup downloads

If your instance doesn't support backup file downloads, use one of the following approaches depending on your goal:

Goal

Solution

Restore to a new ApsaraDB for MongoDB instance

No download needed. See Restore data to an ApsaraDB for MongoDB instance.

Restore to a self-managed database or another ApsaraDB for MongoDB instance

Use Data Transmission Service (DTS) to migrate the data. See Migration solutions for self-managed MongoDB databases or ApsaraDB for MongoDB instances.

Export data for long-term storage

Use the mongodump tool. See the official mongodump documentation.

How to resume an interrupted download

On Linux, add -t 0 to the wget command along with -c. This makes wget retry indefinitely until the download completes:

wget -c -t 0 '<backup-file-download-url>' -O <custom-filename>.<extension>

On Windows or macOS, use the resume option in your browser's download management page.

403 Forbidden error

Check that the download URL is enclosed in single quotation marks (') in the wget command. A URL containing special characters that is not quoted is the most common cause of this error.