For long-term storage of your ApsaraDB for MongoDB data, you can create backups and download the files to a local machine. These files can be restored to a self-managed database for business testing or data analytics. This topic explains how to download backup files.
Before you begin
You are not charged for failed tasks.
You cannot cancel a backup download task after it starts.
A cluster or instance can have only one running or failed download task 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 set conversion fees.
Traffic fees
Internal network download: Free of charge.
Internet download: Each instance receives a free quota of 500 GB per month. Traffic that exceeds this quota 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 Network fees.
Billing point: Billing starts when the actual download begins after the backend task succeeds.
Cost savings: For large-volume downloads, we recommend that you purchase 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 set conversion fees
When you use the download backup file feature for a cloud disk instance, you are charged for converting snapshot backups to BSON files. No free quota is available. The billing standard is as follows:
Region
Conversion fee (CNY/GB)
Public cloud
0.2
Alibaba Finance Cloud/Microfinance Cloud
0.38
Alibaba Gov Cloud
0.4
NoteWhen you download a snapshot backup for a cloud disk instance, the system creates a data conversion task. You are not charged a backup set conversion fee if this task fails.
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 is successful, you must manually generate a download link. The link is valid for a limited period of time.
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; 2 hours by default) 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 because of unsupported data formats. If a task fails, we recommend that you first 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. In this case, we recommend that you perform one of the following operations:
If your ECS instance and ApsaraDB for MongoDB instance are in the same region and both use the classic network, or if they are in the same VPC (with the same VPC ID), we recommend that you download the backup file to the ECS instance over the Private Connection String.
Use a client that supports resumable downloads. For Linux, you can use the
wgetcommand shown below to download backup files.
Download on Windows or macOS
Paste the download URL of the backup file into the address bar of a browser and press Enter. The browser automatically downloads 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