This topic describes how to download backup data from an ApsaraDB RDS for MySQL instance for long-term retention, queries, migration, and auditing.
Before you begin
-
No fees are 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 use downloaded backup data to directly restore an RDS instance. To restore an instance, see Overview of data restoration solutions.
-
Directly downloading a backup is not always the best option. Before you start, identify the instance type and use cases to choose the most efficient and cost-effective solution.
Billing
Public network traffic fees may apply when you download backups from an instance that uses a high-performance local disk. If your instance uses cloud disks, both public network traffic and backup set conversion fees may apply.
If you download backups to OSS, you are charged based on your actual OSS usage.
Network traffic fees
-
Internal network downloads: Free of charge.
-
Public network downloads: Each instance includes a free monthly quota of 500 GB per month. Usage beyond this quota is billed on a pay-as-you-go basis. You can view the downloaded traffic volume on the Basic Information page of the RDS instance. For more information about unit prices, see Network fees.
-
You can download backups over an internal network or the public network for instances that use cloud disks and instances that use a high-performance local disk.
-
When you initiate a snapshot backup download for an instance that uses cloud disks, the system creates a data conversion download task. You cannot obtain a download link while the task is in progress or has failed. No public network traffic fees are incurred during this period. After the task is successfully completed, you are charged for the actual traffic that is generated when you use the download link.
-
A physical backup download for an instance that uses a high-performance local disk does not involve data conversion. You can directly obtain the download link. You are charged for the actual traffic that is generated when you use the link to download the backup.
-
To view the amount of backups downloaded over the public network, go to the RDS Instance List, click the instance ID, and view the Backup Downloads in the Instance Resources section on the Basic Information page.
-
To offset public network traffic fees from downloads, consider purchasing a subscription network plan. Larger plans offer greater discounts.
Backup set conversion fees
This fee applies when you use the advanced download feature for an instance that uses cloud disks to convert a snapshot backup into a CSV (without header), CSV-with-header, SQL, Parquet, or qb.xb (physical backup) file. No free quota is provided. The billing standards are as follows:
|
Region |
Conversion fee (USD/GB) |
|
Public cloud |
0.03125 |
-
When you initiate a snapshot backup download for an instance that uses cloud disks, the system creates a data conversion download task. No backup set conversion fees are charged if this task fails.
-
A decompressed qb.xb (physical backup) file converted from a snapshot backup may be smaller than the Backup Conversion Traffic value displayed in the console.
Download from cloud disk instances
For an instance that uses cloud disks, the advanced download feature lets you create a task for a specific point in time or backup set. You can convert a snapshot backup to CSV, SQL, Parquet, or qb.xb (physical backup) format and download it via a URL or save it directly to an OSS bucket.
Prerequisites
Before you start, make sure that the instance meets all the following conditions:
-
Instance status: Running.
-
Storage type: ESSD cloud disk or high-performance cloud disk.
-
Database version: MySQL 8.0 or 5.7.
-
Region support: The instance resides in one of the following regions: China (Chengdu), China (Shenzhen), China (Guangzhou), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hangzhou), China (Shanghai), China (Hong Kong), Malaysia (Kuala Lumpur), Indonesia (Jakarta), Japan (Tokyo), Singapore, US (Silicon Valley), US (Virginia), or Germany (Frankfurt). Support for other regions is gradually rolling out. The console displays all currently supported regions.
-
Minor engine version: The minor engine version must be later than
20201031. If the minor engine version of your instance does not meet this requirement, upgrade the minor engine version.ImportantIf the minor engine version meets the requirements but the Download Instance Backup button is still unavailable, the database proxy may be enabled. Some instances do not support the advanced download feature due to hardware limitations. To use this feature, you must first disable the database proxy and then upgrade the minor engine version. After the issue is resolved, you can re-enable the proxy service as needed.
-
Backup encryption: Disabled. The advanced download feature is not supported for encrypted instances that use cloud disks.
-
Data archiving: Disabled. The advanced download feature is not supported for instances that use high-performance cloud disks for which the data archiving feature is enabled.
-
RAM permissions: The RAM user must have the permissions to download backup files. To grant the permissions to a RAM user, see Grant permissions to a read-only RAM user to download backup files.
Limitations
-
Unsupported objects: Downloaded backup files do not include expression indexes, foreign keys, generated columns, hidden columns, views, functions, stored procedures, system variables, or triggers.
-
Unsupported databases: The download does not include system databases such as
information_schema,mysql,performance_schema,sys, and__recycle_bin__. -
Unsupported data types: The download task may fail if a table contains special data types such as
GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, or GEOMETRYCOLLECTION. -
Name restrictions: Database and table names cannot contain the forward slash (/) character, or the download task will fail.
-
Storage type restrictions: If the download destination is an OSS bucket, the storage class of the target bucket must be Standard. To save a downloaded backup to an OSS bucket with a different storage class, use one of the following methods:
-
Method 1: Download the backup to a bucket that uses the Standard storage class, and then convert the storage class.
-
Method 2: Download the backup to your computer, and then upload it to the destination bucket.
-
Procedure
-
Go to the backup list
-
Go to the RDS instance list. In the top navigation bar, select the region where your RDS instance resides. Then, find your RDS instance and click its ID.
-
In the left-side navigation pane, click Restoration > Base Backups.
-
-
Start a download task
-
Download a log backup: On the Log Backup tab, find the desired log file and click Download in the Actions column. Log backup must be enabled.
-
Download a data backup: On the Data Backup tab, find the backup set that you want to download and click Download Instance Backup in the Actions column.
-
-
Configure instance backup download parameters
-
In the Download Time Point and Backup Set step, select Download by Backup Set or Download by Time Point based on your business requirements, 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)
-
Enter the name of the destination OSS bucket and a directory prefix.
-
Select a download format: CSV (without header), CSV-with-header, SQL, Parquet, or qb.xb (physical backup).
-
If this is the first time you use this feature, click Go to Authorize > Agree to Authorization as prompted to grant ApsaraDB RDS the permissions to access OSS.
URL
-
Select URL.
-
Select a download format.
-
After the task succeeds, you must manually generate a download link, which is valid for a limited time.
-
-
-
Confirm and execute Read the notice and check the box, 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: After the task status changes to Successful, the file is automatically downloaded to the specified OSS bucket and directory.
-
URL method: After the task status changes to Successful, click Generate Link in the Download Destination column within the validity period of 3 days. Then, set the validity period of the link, which can range from 5 minutes to 1 day. The default validity period is 2 hours. After you set the validity period, you can obtain an internal or public network download address. The system automatically deletes the temporary data when the task and link expire. If the link expires, you must start a new download task.
ImportantThe conversion process competes for computing resources, and downloads may fail due to temporary resource allocation issues or unsupported data formats. If a task fails, we recommend retrying.
-
-
Use a command-line tool to download the file
After you obtain the URL for the download:
-
Use a command-line tool, such as wget or curl, to download the file. This is the recommended method. For more information, see Appendix 1: Download commands in this topic.
-
If the file is small, you can copy the public network URL to the address bar of your browser.
-
Download from high-performance local disk instances
Downloading backups from an instance that uses a high-performance local disk is more direct because it does not require data format conversion. You can immediately obtain the download link for a physical backup or a log backup.
Prerequisites
Before you start, make sure that the instance meets all the following conditions:
-
Storage type: High-performance local disk.
-
RAM permissions: The RAM user must have the permissions to download backup files. To grant the permissions to a RAM user, see Grant permissions to a read-only RAM user to download backup files.
Procedure
-
Go to the backup list
-
Go to the RDS instance list. In the top navigation bar, select the region where your RDS instance resides. Then, find your RDS instance and click its ID.
-
In the left-side navigation pane, click Backup and Restoration > Base Backup List.
-
-
Obtain the download link
-
Click the Data Backup or Log Backup tab.
-
Find the backup file that you want to download and click Download Instance Backup or Download in the Actions column.
-
In the dialog box that appears, you can copy the internal URL or the public network URL.
-
Internal URL: Recommended. To use this fast and free method, download the backup from an Alibaba Cloud ECS instance in the same region and VPC as the RDS instance. Cross-region downloads over the internal network are not supported.
-
Public network URL: Use this URL to download from your computer or another network environment.
-
-
-
Use a command-line tool to download the file
After you obtain the URL for the download:
-
Use a command-line tool, such as wget or curl, to download the file. This is the recommended method. For more information, see Appendix 1: Download commands in this topic.
-
If the file is small, you can copy the public network URL to the address bar of your browser.
-
-
The backup download link is valid for 48 hours. Download the file promptly to avoid expiration. If the link expires, you must start a new download task to obtain a new link. A download already in progress is not affected by link expiration.
-
A log backup is a backup of local logs. To obtain local logs, see mysqlbinlog.
-
If an instance is of the High-availability Edition or three-node edition, both the primary and secondary instances generate log backups. You can view the IDs of the primary and secondary instances on the Service Availability page.
-
If you want to restore data to a self-managed database, the point in time of the data backup must be within the time range of the log backup. The log backup and data backup must be from the same instance.
Appendix 1: Download commands
After you obtain a URL for the download, we recommend that you use a command-line tool, such as wget or curl, to download the file. These tools support resumable downloads and help ensure stability.
-
If the network download speed is lower than 64 KB/s, the download may be interrupted. Make sure that you have a stable network connection during the download.
-
If you download a backup file to an ossfs-mounted disk, you may also need to adjust the multipart_size parameter of ossfs. By default, this parameter supports a maximum file size of 100 GB. If a backup set is larger than 100 GB, the download fails. For more information about ossfs and how to configure its parameters, see ossfs and Mounting options.
-
We recommend using the wget or curl commands provided in this topic to download backup sets. Other third-party tools might repeatedly download the file, causing the downloaded data size to exceed the backup set size. This results in extra public network traffic fees.
wget
nohup wget -c -t 0 "Backup file download URL" -O "Path and filename for the downloaded file" > "Download process monitoring log" &
Parameter description:
|
Parameter |
Description |
|
nohup |
Keeps the download process running even if the terminal is disconnected. The process exits automatically upon completion. |
|
-t |
The number of retries. If you set this parameter to 0, an unlimited number of retries are allowed. |
|
-c |
Enables resumable downloads. |
|
-O |
The path and filename for the downloaded file. |
Example:
nohup wget -c -t 0 "https://dbs-****.aliyundoc.com/****.tar.gz****" -O /backup/examplebackup.tar.gz > /tmp/download.log &
curl
nohup curl -C - --retry 10 "Backup file download URL" -o "Path and filename for the downloaded file" > "Download process monitoring log" &
Parameter description:
|
Parameter |
Description |
|
nohup |
Keeps the download process running even if the terminal is disconnected. The process exits automatically upon completion. |
|
--retry |
The number of retries that are allowed if the task fails. In this example, the value is set to 10, which indicates that 10 retries are allowed. |
|
-C - |
Enables automatic resumable downloads. |
|
-o |
The path and filename for the downloaded file. |
Example:
nohup curl -C - --retry 10 "https://dbs-****.aliyundoc.com/****.tar.gz****" -o examplebackup.tar.gz > /tmp/download.log &
Appendix 2: Use cases
|
Scenario and purpose |
Recommendation |
|
Choose one of the following methods:
|
|
Choose one of the following methods:
|
|
Choose one of the following methods:
|
|
Upload a backup to OSS |
RDS backups are stored in a dedicated backup storage space and do not occupy the storage space of your instance. To store backups in an OSS bucket, you can choose one of the following methods:
|
|
Retain backups long-term |
|
|
Automatically download backups |
|
|
Download a binary log |
|
Related documents
-
When you use the backup download feature for an instance that uses cloud disks and select URL as the download destination to convert snapshot backup data to the qb.xb (physical backup) format, the downloaded file is in tar.gz or tar.zst format. For more information about how to decompress the backup file, see Download and decompress a backup file. Then, you can restore the file to a self-managed database. For more information, see Restore a physical backup file of an ApsaraDB RDS for MySQL instance to a self-managed database.
-
After you use the backup download feature to convert and export snapshot backup data from an instance that uses cloud disks to a CSV or SQL file, you can restore the ApsaraDB RDS for MySQL snapshot backup file to a self-managed database.
-
To perform query analysis on the data of an ApsaraDB RDS for MySQL instance that uses cloud disks, you can use the advanced download feature to download the data directly to Alibaba Cloud OSS. Then, you can import the data from OSS to AnalyticDB for MySQL (ADB) for query analysis. For more information, see Import the backup data of an ApsaraDB RDS for MySQL instance that uses cloud disks to an AnalyticDB for MySQL cluster.
-
For an instance that uses a high-performance local disk, you can use the backup download feature and the mysqldump tool to restore an ApsaraDB RDS for MySQL logical backup file to a self-managed database.
-
For an instance that uses a high-performance local disk, you can use the backup download feature to restore an ApsaraDB RDS for MySQL physical backup file to a self-managed database.
-
You can also call API operations to download backups. The following API operations are available:
-
To download backups for other database engines, see the following topics:
FAQ
For more information about downloading backups, see FAQ about backup downloads.