All Products
Search
Document Center

ApsaraDB for MongoDB:Download backup files

Last Updated:Mar 28, 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.

Usage notes

  • Only one download task can run per instance at a time. 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.

  • Downloaded backup data cannot restore an ApsaraDB for MongoDB instance directly. To restore an instance, see Data restoration.

  • Failed tasks are not charged.

Billing

Billing differs depending on whether your instance uses a cloud disk or a local disk.

  • Downloading via Public Connection String or Private Connection String is free of charge.

  • 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 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

    Converting a snapshot backup to a BSON file costs USD 0.03125/GB (public cloud only, no free quota). No conversion fee is charged if the task fails.

    Region

    Conversion fee (USD/GB)

    Public cloud

    0.03125

Download backups for cloud disk instances

Applicability

Your instance must meet all of the following requirements:

RequirementDetails
ArchitectureReplica set (excluding single-node instances) or sharded cluster
Storage typeESSD cloud disk
Instance statusRunning
Backup encryptionBackup data must not be encrypted
RegionPublic 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 permissionsIf 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 Download Point-in-time and Backup Set step, select a Backup Set and click Next.

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

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

    Download destinationSteps
    OSS (Recommended)1. Select Write data to your OSS. <br>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. <br>3. For Download Format, keep the default value BSON. <br>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.
    URL1. Select URL. <br>2. Select the download format. <br>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.

Get the backup file

OSS method: After the task status changes to Successful, the backup file appears automatically in the specified OSS bucket and directory.

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

Important

Temporary data is deleted automatically when the link expires, or after 3 days if no link is generated. To retrieve the file after this point, 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>
ParameterDescription
-cEnables 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-hz-v3.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:

GoalSolution
Restore to a new ApsaraDB for MongoDB instanceNo download needed. See Restore data to an ApsaraDB for MongoDB instance.
Restore to a self-managed database or another ApsaraDB for MongoDB instanceUse 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 storageUse 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.