If you want to retain ApsaraDB for MongoDB data for a long time, you can back up the data and then download it to your computer or restore it to a self-managed database. This method is applicable to scenarios such as business testing or data analysis. This topic describes how to download a backup file.
Prerequisites
Only the backup files of instances that run MongoDB 4.2 or earlier and use local disks can be downloaded.
Limits
You can download only physical backup files and logical backup files but not snapshot backup files.
Billing rules
You are not charged for downloading backup files by using a Public Connection String or Private Connection String.
Obtain the download URL of backup files
Go to the Replica Set Instances or Sharded Cluster Instances page. In the top navigation bar, select the region in which an instance resides. Then, find the instance and click the ID of the instance.
In the left-side navigation pane of the instance details page, click Backup and Restoration.
On the Full Backup tab, find the backup file that you want to download and then click Download in the Actions column.
In the Download Backup dialog box, copy and record the Public Connection String or Private Connection String value.
Click OK.
Download the backup file
If your network connection is unstable, a timeout occurs when you use the copied Public Connection String to download the backup file. We recommend that you use the following methods:
If your Elastic Compute Service (ECS) instance and ApsaraDB for MongoDB instance are in the same region and use the same classic network or virtual private cloud (VPC), you can download the backup file by using the copied Private Connection String on the ECS instance.
Download the backup file on a client that supports the resumable download feature. For the Linux operating system, you can use the following
wget
command to download backup files.
Download the backup file in Windows or macOS
Paste the copied public endpoint into the address bar of your browser, and then press the Enter key to start the automatic download.
Download the backup file in Linux
Run the following command to download the backup file:
wget -c '<URL that is used to download the backup file>' -O <Name of the backup file><Suffix of the backup file>
Parameters:
-c: enables the resumable download feature.
-O: specifies the downloaded result as the file name.
<Suffix of the backup file>: generally sets the suffix of the backup file to
_qp.xb
or.tar.gz
. Make sure that the suffix of the backup file is the same as that of 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