You can back up your ApsaraDB for MongoDB data and download the backup files to your local machine for long-term storage. You can also restore the backup files to a self-managed database for purposes such as business testing or data analytics. This topic describes how to download a backup file.
Before you begin
No fees are charged for failed tasks.
You cannot cancel a backup download task after it starts.
You cannot use downloaded backup data to directly restore an ApsaraDB for MongoDB instance. To restore an instance, see Data restoration.
Billing
No fees are charged when you download backup files for local disk instances using a Public Connection String or a Private Connection String.
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 comes with a free quota of 500 GB per month. You are charged for traffic that exceeds this quota on a pay-as-you-go basis. You can view the downloaded traffic volume on the Basic Information page of your MongoDB instance. For information about unit prices, see .
Billing point: Billing starts when the actual download begins after the background task is successful.
Cost savings: For large-volume downloads, you can purchase a subscription network plan to offset the costs.
Download to OSS: This incurs additional OSS fees. To avoid unnecessary storage costs, manually delete these files after you finish using them.
Backup set conversion fees
When you download a backup file for a cloud disk instance, you are charged for converting a snapshot backup into a BSON file. No free quota is provided.
Region
Conversion fee (USD/GB)
Public cloud
0.03125
NoteAfter you start a snapshot backup download for a cloud disk instance, the system creates a data conversion download task. No backup set conversion fees are charged if this task fails.
Download a backup for a cloud disk instance
Applicability
The MongoDB instance must meet the following requirements:
Service architecture: Replica set (excluding single-node) or sharded cluster.
Storage type: ESSD cloud disk.
Status: Running.
The instance is in one of the following regions (public cloud only): 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).
The backup data is not encrypted.
If you use a Resource Access Management (RAM) user, the user must have permissions to download backup files.
Supported data for instance backup downloads
Unsupported:
The admin, local, or config system databases.
System tables that start with "system.".
Views or functions.
Time-series collections.
Supported: Collections (non-time-series) and index information.
Procedure
Navigate to the backup list
Go to the ApsaraDB for MongoDB replica set instances or sharded cluster instances list. Select a resource group and a region at the top of the page, and then click the ID of the target instance.
In the navigation pane on the left of the instance details page, click Backup and Restoration.
click Backup Download List.
Start the download task: On the Backup Download List tab, click Download Instance Backup.
Configure the download parameters
In the Download Point-in-time and Backup Set step, select the required 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, configure the download destination and format.
Download Destination
Configuration
OSS (Recommended)
Select Write data to your OSS.
Enter the bucket name and folder prefix for the destination OSS.
Only the Standard storage class for OSS is supported. To convert the storage class, see Convert storage class.
Set Download Format to the default value BSON.
If this is your first time using this feature, click Authorize > Agree to Authorization as prompted to grant ApsaraDB for MongoDB 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 time.
Confirm and execute Read and select the notice, 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 for the task status to change to Successful. The file is automatically saved to the specified OSS bucket and folder.
URL method: Wait for the task status to change to Successful. The download task is valid for 3 days. During this period, click Generate Link in the Download Destination column. Set the validity period of the link, which can be from 5 minutes to 1 day. The default is 2 hours. You can then obtain the internal or external download URL. After the task and the link expire, the temporary data is automatically deleted. You must start a new download task to obtain the file.
ImportantThe download may fail if computing resources cannot be allocated due to contention on the service side. The download may also fail because of unsupported data formats. If a task fails, you can retry the download task or contact Data Disaster Recovery support.
Download the file using a command-line tool
After you obtain the download URL:
Use a command-line tool such as wget or curl to download the file (Recommended). For more information, see Appendix 1: Download commands in this topic.
For small files, you can copy the external download URL to the address bar of your browser.
Download a backup for a local disk instance
Applicability
You can download backup files only for local disk instances that run MongoDB 4.2 or earlier.
Backup file downloads are supported for only Physical Backups and Logical Backups, but not for Snapshot Backups. To download backup files for other instances, see What do I do if my instance does not support backup file downloads?.
Procedure
Navigate to the backup list
Go to the ApsaraDB for MongoDB replica set instances or sharded cluster instances list. Select a resource group and a region at the top of the page, and then click the ID of the target instance.
In the navigation pane on the left of the instance details page, click Backup and Restoration.
Start a download task
On the Full Backup tab, find the target backup file and click Download in the Actions column.
In the Download Backup dialog box that appears, Copy the Public Connection String or Private Connection String as required.
Click OK.
Download the file using a command-line tool
After you obtain the download URL:
Use a command-line tool such as wget or curl to download the file (Recommended). For more information, see Appendix 1: Download commands in this topic.
For small files, you can copy the external download URL to the address bar of your browser.
Appendix 1: Download commands
If you have a poor network connection, a timeout may occur when you download a file using the Public Connection String. We recommend that you take the following measures:
If your ECS instance and MongoDB instance are in the same region and both use the classic network or are in the same virtual private cloud (VPC), we recommend that you use the Private Connection String to download the backup file on the ECS instance.
Use a client that supports resumable downloads. For the Linux operating system, you can use the following
wgetcommand to download the backup file.
Download a backup file on Windows or macOS
Paste the download URL of the backup file into the address bar of your browser and press Enter. The browser automatically downloads the backup file.
Download a backup file on Linux
Run the following command to download the backup file.
wget -c '<Backup_file_download_URL>' -O <Custom_file_name><File_name_extension>Parameter description:
-c: Enables resumable download mode.
-O: Saves the downloaded content to a file with a specified name.
<File_name_extension>: The extension is typically
_qp.xbor.tar.gz. Ensure that the extension is the same as the one 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