You can download ApsaraDB for MongoDB backup files to a local machine for long-term storage, or restore them to a self-managed database for business testing or data analytics.
Before you begin
-
You are not charged for failed tasks.
-
You cannot cancel a backup download task after it starts.
-
Only one download task (running or failed) is allowed per cluster or instance at a time.
-
You cannot directly restore an ApsaraDB for MongoDB instance from a downloaded backup file. To restore an instance, see Restore an instance from a backup file.
Billing
-
For instances that use local disks, downloading backup files by using a Public Connection String or a Private Connection String is free of charge.
-
For instances that use cloud disks, downloading backups incurs outbound internet traffic and backup data computation fees.
Traffic fees
-
Internal network download: Free of charge.
-
Internet download: Each instance has a free quota of 500 GB per month. Excess traffic is billed on a pay-as-you-go basis. You can view the downloaded traffic volume on the basic information page of your ApsaraDB for MongoDB instance. For more information about the pricing, see .
-
Billing point: Billing starts when the actual download begins after the backend task succeeds.
-
Cost savings: For large-volume downloads, consider purchasing a subscription network plan to offset traffic costs.
-
Download to OSS: Additional OSS fees apply. To avoid ongoing storage charges, manually delete these files when you no longer need them.
Backup data computation fees
When you download backup files from a cloud disk instance, snapshot backups are converted to BSON files, which generates data computation costs. No free quota is available. The billing standard is as follows:
Region
Data computation fee (USD/GB)
Public cloud
0.03125
NoteIf the data conversion task fails, you are not charged a backup data computation fee.
-
Download backups for cloud disk instances
Prerequisites
Your ApsaraDB for MongoDB instance must meet the following requirements:
-
Architecture: replica set (excluding single-node instances) or sharded cluster.
-
Storage type: ESSD cloud disk.
-
Status: Running.
-
Region: The instance is in one of the supported public cloud 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), or US (Virginia).
-
Backup data is not encrypted.
-
If you use a RAM user, ensure the user has the required permissions to download backup files.
Supported and unsupported data
-
Unsupported:
-
The system databases
admin,local, andconfig. -
System collections whose names start with
system.. -
Views and functions.
-
Time-series collections.
-
The download task fails if database or collection names contain forward slashes (/).
-
-
Supported: Non-time-series collections and index information.
Procedure
-
Go to the backup list
-
Go to the ApsaraDB for MongoDB Replica Set Instances page or the ApsaraDB for MongoDB Sharded Cluster Instances page. Select the resource group and region, and then click the ID of the target instance.
-
In the left-side navigation pane of the target instance page, click Backup and Restoration.
-
On the Backup Download List tab, click Download Instance Backup File.
-
-
Start a download task: On the Backup Download tab, click Download Instance Backup File.
-
Configure parameters for instance backup download
-
In the Point in Time and Backup Set step, select a Backup Set to download, and then click Next.
-
In the Instance, Database, and Table step, retain the default settings to download the instance backup, and then click Next.
-
In the Destination and Format step, configure the download destination and format.
Destination
Configuration
OSS (Recommended)
-
Select Write data to your OSS.
-
Enter the bucket name and directory prefix of the destination OSS bucket.
Only the Standard storage class is supported for OSS. To change the storage class, see Convert storage classes.
-
Select a Download Format. The default format is BSON.
-
If this is the first time you use this feature, click Go to Authorize > Agree to Authorization as prompted to grant ApsaraDB for MongoDB the permissions to access OSS.
URL
-
Select URL.
-
Select a download format.
-
After the task succeeds, you must manually generate a download link. The link is valid for a limited period.
-
-
-
Confirm and run the task: Read and agree to the terms, and then click Complete. You are redirected to the Backup Download List tab, where you can monitor the task status.
-
Obtain the backup file
-
OSS method: Wait until the task status changes to Successful. The file is automatically stored in the specified OSS bucket and directory.
-
URL method: After the task status changes to Successful, click Generate Link in the Destination column within the 3-day validity period. Set a link validity period (from 5 minutes to 1 day; default is 2 hours) to get the download URL. When the task and link expire, the temporary data is automatically deleted and you must start a new download task.
ImportantDownload tasks may fail due to temporary resource allocation failures during data conversion or unsupported data formats. If a task fails, retry it or contact the Data Disaster Recovery technical support team.
-
-
Use a command-line tool to download the file
After obtaining the URL:
-
We recommend that you use a command-line tool, such as wget or curl, to download the file. For more information, see Appendix 1: Download commands in this topic.
-
For small files, you can copy the internet URL to the address bar of a browser to download the file.
-
Download backups for local disk instances
Prerequisites
-
You can download backup files only for local disk instances that run MongoDB 4.2 or earlier.
-
Only Physical Backup and Logical Backup files can be downloaded. Snapshot Backup backups cannot be downloaded. To download backup files from other instances, see What do I do if my instance does not support backup file downloads?.
Procedure
-
Go to the backup list
-
Go to the ApsaraDB for MongoDB Replica Set Instances page or the ApsaraDB for MongoDB Sharded Cluster Instances page. Select the resource group and region, and then click the ID of the target instance.
-
In the left-side navigation pane of the target instance page, click Backup and Restoration.
-
-
Start a download task
-
On the Full Backup tab, find the backup file that you want to download and click Download in the Actions column.
-
In the Download Backup dialog box, Copy and take note of the Public Connection String or Private Connection String as needed.
-
Click Confirm.
-
-
Use a command-line tool to download the file
After obtaining the URL:
-
We recommend that you use a command-line tool, such as wget or curl, to download the file. For more information, see Appendix 1: Download commands in this topic.
-
For small files, you can copy the internet URL to the address bar of a browser to download the file.
-
Appendix 1: Download commands
If your network connection is unstable, downloading over the Public Connection String may time out. To resolve this issue:
-
If your ECS instance and ApsaraDB for MongoDB instance are in the same region and both use the classic network, or are in the same VPC (with the same VPC ID), download the backup file to the ECS instance over the Private Connection String.
-
Use a client that supports resumable downloads. On Linux, you can use the
wgetcommand shown below.
Download on Windows or macOS
Paste the download URL into your browser's address bar and press Enter to download the backup file.
Download on Linux
Run the following command to download a backup file:
wget -c '<Download URL of the backup file>' -O <Custom filename><Suffix>
Parameters:
-
-c: enables resumable download mode.
-
-O: saves the downloaded file with the specified filename.
-
<Suffix>: The file extension is typically
_qp.xbor.tar.gz. Make sure that the extension is the same as that 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