You can download ApsaraDB for MongoDB backup files for long-term local storage. You can also restore 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
You are not charged for failed tasks.
You cannot cancel a backup download task after it starts.
You cannot use a downloaded backup file to directly restore an ApsaraDB for MongoDB instance. For more information about how to restore an instance, see Data restoration.
Billing
Downloading backup files from local disk instances using a Public Connection String or a Private Connection String is free of charge.
If you download a backup file from a cloud disk instance, you are charged for outbound traffic and backup set conversion.
Traffic fees
Internal network downloads: Free of charge.
Internet downloads: Each instance has a free quota of 500 GB per month. You are charged for usage that exceeds the free quota on a pay-as-you-go basis. You can view the traffic volume of downloaded data on the Basic Information page of the MongoDB instance. For information about unit prices, see .
Billing point: Billing starts when the download begins after the background task succeeds.
Cost savings: To save on costs for large traffic downloads, you can purchase a subscription network plan.
Download to OSS: This action incurs additional OSS fees. To avoid unnecessary storage costs, manually delete these files after you confirm they are no longer needed.
Backup set conversion fee
When you download a backup file from a cloud disk instance, you are charged a fee for converting the snapshot backup to a BSON file. No free quota is provided. The billing standards are as follows:
Region
Conversion fee (USD/GB)
Public Cloud
0.03125
NoteWhen you initiate a snapshot backup download for a cloud disk instance, the system creates a data conversion download task. You are not charged a backup set conversion fee if this task fails.
Download a backup file from a cloud disk instance
Scope
Your MongoDB instance must meet all the following conditions:
Service architecture: Replica set (excluding single-node instances) 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, or Germany (Frankfurt).
The backup data is not encrypted.
If you use a Resource Access Management (RAM) user, the user must have the permissions to download backup files.
Supported data
The following items are not supported:
The admin, local, and config system databases.
System tables that start with "system.".
Views and functions.
Time-series collections.
The following items are 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. In the upper-left corner of the page, select a resource group and a region. Then, click the ID of the target instance.
In the navigation pane on the left of the instance details page, click Backup and Restoration.
On the Backup Download List tab, click Instance Backup Download.
Initiate a download taskOn the Backup Download tab, click Instance Backup Download.
Configure instance backup download parameters
In the Download Time Point and Backup Set step, select a Backup Set to download, and then click Next.
In the Download Instance and Database/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 directory prefix of the destination OSS.
Only the Standard storage class for OSS is supported. To change the storage class, see Change the storage class.
Set Download Format to BSON, which is the default value.
If this is your first time using this feature, follow the prompts to click Go to Authorization > Agree to Authorization 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 executeRead and select the checkbox to agree to the terms, and then click Finish. 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 automatically appears in the specified OSS bucket and directory.
URL method: Wait for the task status to change to Successful. Within the validity period of 3 days, click Generate Link in the Download Destination column. Set the link validity period (5 minutes to 1 day, default: 2 hours) to obtain the internal or external download URL. After the task and the link expire, the temporary data is automatically cleared. You must then initiate a new download task.
ImportantA download may fail because of a temporary resource allocation failure or an unsupported data format. If a task fails, you can retry the download or contact Data Disaster Recovery technical support.
Use a command-line tool to download the file
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 paste the external download URL directly into your browser's address bar.
Download a backup file from a local disk instance
Applicability
Only local disk instances of ApsaraDB for MongoDB 4.2 and earlier support downloading backup files.
Only Physical Backups and Logical Backups can be downloaded. Snapshot Backups cannot be downloaded. For information about how 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. In the upper-left corner of the page, select a resource group and a region. Then, click the ID of the target instance.
In the navigation pane on the left of the instance details page, click Backup and Restoration.
Initiate 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, Copy and record the Public Connection String or Private Connection String as needed.
Click OK.
Use a command-line tool to download the file
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 paste the external download URL directly into your browser's address bar.
Appendix 1: Download commands
If you have a poor network connection, a timeout may occur when you download from a 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) (with the same VPC ID), we recommend that you download the backup file on the ECS instance using a Private Connection String.
Use a client that supports resumable downloads. For Linux operating systems, you can use the
wgetcommand below to download the backup file.
Download a backup file on a Windows or macOS system
Paste the backup file download URL into your browser's address bar and press Enter. The browser automatically downloads the backup file.
Download a backup file on a Linux system
Run the following command to download the backup file.
wget -c '<Backup_File_Download_URL>' -O <Custom_File_Name><Suffix>Parameter description:
-c: Enables resumable download mode.
-O: Saves the downloaded content to a file with the specified name.
<Suffix>: Usually
_qp.xbor.tar.gz. Make sure it matches the file suffix 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