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:
| 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, andconfigsystem databasesSystem 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
Start a download task
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.
In the left-side navigation pane, click Backup and Restoration.
On the Backup Download List tab, click Download Instance Backup File.
In the Download Point-in-time and Backup Set step, select a Backup Set and click Next.
In the Download Instance, Database, and Table step, keep the default setting (instance download) and click Next.
In the Download Destination and Format step, choose a download destination.
Download destination Steps 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. URL 1. 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. 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.
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
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.
In the left-side navigation pane, click Backup and Restoration.
On the Full Backup tab, find the backup file you want to download and click Download in the Actions column.
In the Download Backup dialog box, copy the Public Connection String or Private Connection String.
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-hz-v3.oss-cn-hangzhou-internal.aliyuncs.com/custins5475****/hins1907****_data_20210906103710_qp.xb?Expires=......' -O backupfile_qp.xb