This topic describes how to download ApsaraDB RDS for MySQL backups for various purposes, including long-term retention, querying, 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 running or failed task can exist at a time for a given cluster or instance.
You cannot use downloaded backup data to restore an ApsaraDB RDS instance directly. To restore an instance, see Overview of data restoration solutions.
Directly downloading a backup is not always the best option. Before you start, identify your instance type and scenario to choose the most efficient and cost-effective method.
Billing details
Downloading backups from an instance with high-performance local disks may incur outbound network traffic fees. For instances that use cloud disks, you may be charged for both outbound network traffic and backup set conversion.
If you download backups to Object Storage Service (OSS), you are charged based on your actual usage of OSS.
Network traffic fees
Internal network downloads: Free of charge.
External network downloads: Each instance receives a free quota of 500 GB per month. Usage beyond this quota is billed on a pay-as-you-go basis. You can view the amount of downloaded traffic on the Basic Information page of the ApsaraDB RDS instance. For more information about unit prices, see Network fees.
You can download backups over an internal network or the internet for instances that use cloud disks and instances with high-performance local disks.
When you start a snapshot backup download for an instance that use cloud disks, the system creates a data conversion task. You cannot obtain a download link while the task is in progress or has failed. No outbound network traffic fees are incurred during this period. After the task completes successfully, you are charged for the actual traffic generated when you use the download link.
Physical backup downloads for instances with high-performance local disks do not involve data conversion. You can obtain the download link directly. You are charged for the actual traffic generated when you use the link to download the backup.
To view the public network backup download volume, go to the ApsaraDB RDS instance list, click the instance ID, and on the Basic Information page, view Backup Download Volume in the Instance Resources section.
You can purchase a subscription network plan to cover data transfer fees for downloading backups over the public network. The larger the network plan capacity, the higher the discount.
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 file (without a header), a CSV file with a header, an SQL file, or a Parquet file. No free quota is provided. The billing standards are as follows:
Region | Conversion fee (USD/GB) |
Public cloud | 0.03125 |
When you start a snapshot backup download for an instance that uses cloud disks, the system creates a data conversion task. No backup set conversion fees are charged if this task fails.
Download backups from a cloud disk instance
Instances that use cloud disks support Advanced Download tasks for a specific point in time or a specific backup set. You can convert snapshot backups into CSV, SQL, or Parquet format as needed. You can also download the backup to a URL or save the backup file directly to your OSS bucket.
Prerequisites
Before you start, make sure that the instance meets all the following conditions.
Instance status: Running.
Storage type: Enterprise SSD (ESSD) or Premium Performance Disk.
Database version: MySQL 8.0 or 5.7.
Region support: China (Chengdu), China (Shenzhen), China (Guangzhou), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hangzhou), China (Shanghai), Hong Kong (China), Malaysia (Kuala Lumpur), Indonesia (Jakarta), Japan (Tokyo), Singapore, US (Silicon Valley), US (Virginia), and Germany (Frankfurt). This feature is being gradually rolled out to other regions. The supported regions are displayed in the console.
Minor engine version: The minor engine version must be
20201031or later. If the minor engine version of your instance does not meet this requirement, upgrade the minor engine version.ImportantThe Download Instance Backup button may be unavailable if the database proxy is enabled, even if the minor engine version meets the requirements. This is because some instances have hardware limitations that prevent them from supporting this download feature. To resolve this issue, 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 premium performance disks for which data archiving is enabled.
RAM permissions: The Resource Access Management (RAM) user must have permissions to download backup files. To grant permissions to a RAM user, see Grant permissions to a read-only RAM user to download backup files.
Feature limitations
Unsupported objects: The 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, or__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 restriction: The names of the downloaded databases and tables cannot contain forward slashes (/). If your database or table names contain forward slashes, the task will fail.
Storage type restriction: You can only download backups to OSS buckets that use the Standard storage class. If you want to save a backup to an OSS bucket that uses a storage class other than Standard, use one of the following methods:
Method 1: Download the backup to a bucket with the Standard storage class, and then transform the storage class.
Method 2: Download the backup to a local machine, and then upload it to the destination bucket.
Procedure
Navigate to the backup list
Go to the ApsaraDB RDS instance list, select the instance's region, and then click the instance ID.
In the left navigation pane, click Backup and Restoration > Base Backup List.
Start the download task
Download a log backup: On the Log Backup tab, find the target log file and click Download in the Actions column to obtain the download link. This requires that you enable log backup.
Download a data backup: On the Data Backup tab, find the target backup set 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 as needed, 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 bucket name and directory prefix of the destination OSS.
Set Download Format to CSV (without header), CSV-with-header, SQL, or Parquet.
If this is your first time using this feature, click Go to Authorize > Agree to Authorization as prompted to grant ApsaraDB RDS permissions to access OSS.
URL
Select URL.
Select the 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 accept the terms, and then click Finish. You are automatically redirected to the Backup Download List tab, where you can monitor the task status.
Obtaining the backup file
OSS method: Wait for the task status to become Successful. The file is then automatically downloaded to the specified OSS bucket and directory.
URL method: Wait for the task status to become Successful. Within 3 days, click Generate Link in the Download Destination column to generate a download URL. You can set the validity period of the link from 5 minutes to 1 day. The default period is 2 hours. After the task and the link expire, the temporary data is automatically deleted. You must start a new download task if the link expires.
ImportantBecause the conversion process competes for computing resources from the service, a download may fail due to temporary resource allocation failures or unsupported data formats. If a task fails, try to download the backup again.
Use a command-line tool to download the file
After you obtain the URL download link:
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.
If the file is small, you can copy the external URL to your browser's address bar.
Downloads for instances with Premium Local SSDs
The process for downloading backups from an instance with high-performance local disks is more straightforward. This process does not require data format conversion, and 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 permissions to download backup files. To grant permissions to a RAM user, see Grant permissions to a read-only RAM user to download backup files.
Procedure
Navigate to the backup list
Go to the ApsaraDB RDS instance list, select the instance's region, and then click the instance ID.
In the navigation pane on the left, click Backup and Restoration > Base Backup List.
Obtain the download link
Select the Data Backup or Log Backup tab.
Find the target backup file and click Download Instance Backup or Download in the Actions column.
In the dialog box that appears, you can directly copy the internal URL or the external URL.
Internal URL: This is the recommended method. You must download the backup from an Alibaba Cloud ECS instance that is in the same region and VPC. This method is fast and free of charge. Cross-region downloads over the internal network are not supported.
External URL: Use this to download from a local machine or another network environment.
Use a command-line tool to download the file
After you obtain the URL download link:
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.
If the file is small, you can copy the external URL to your browser's address bar.
The backup download link is valid for 1 hour. Download the file promptly to prevent the link from expiring. If the link expires, you must start a new download task to obtain a new link. A download task that has already started is not affected by the link's validity period.
A log backup is a copy of the binary logs. To retrieve binary logs, see mysqlbinlog.
For high-availability series or three-node edition instances, 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, which means they must have the same instance ID.
Appendix 1: Download commands
After you obtain the URL download link, 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 too low (less than 64 KB/s), the download may be interrupted. Make sure you have a stable network connection during the download.
The multipart_size parameter of ossfs has a default maximum file size of 100 GB. To download a backup set that is larger than 100 GB to an ossfs-mounted disk, you must increase the value of this parameter. Otherwise, the download will fail. For more information about ossfs and its parameter settings, see ossfs and Mounting options.
Use the wget or curl commands provided in this topic to download backup sets. If you use other third-party tools, the file may be downloaded repeatedly. This can result in the actual downloaded data size being larger than the backup set size, which incurs extra fees for the outbound traffic that exceeds the backup set size.
wget
nohup wget -c -t 0 "Backup file download URL" -O Path_and_filename_to_save_the_downloaded_file > Download_process_monitoring_log &Parameters:
Parameter | Description |
nohup | Prevents the download from being interrupted if the terminal disconnects or if you accidentally perform a copy operation. The process automatically exits after the download is complete. |
-t | Number of retries. Set to 0 for infinite retries. |
-c | Supports resumable downloads. |
-O | The path and filename to save 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_to_save_the_downloaded_file > Download_process_monitoring_log &Parameters:
Parameter | Description |
nohup | Prevents the download from being interrupted if the terminal disconnects or if you accidentally perform a copy operation. The process automatically exits after the download is complete. |
--retry | Number of retries if the task fails. Set to 10 to retry 10 times. |
-C - | Supports automatic resumable downloads. |
-o | The path and filename to save the downloaded file. |
Example:
nohup curl -C - --retry 10 "https://dbs-****.aliyundoc.com/****.tar.gz****" -o examplebackup.tar.gz > /tmp/download.log &Appendix 2: Scenarios
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 | ApsaraDB RDS backups are stored in backup storage and do not occupy instance storage space. To store backups in OSS, you can choose one of the following methods:
|
Long-term backup retention |
|
Automatically download backups | |
Download binary logs |
|
Related documents
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 use the file to restore the ApsaraDB RDS for MySQL snapshot backup to a self-managed database.
To perform query and 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 your Alibaba Cloud OSS. Then, you can import the data from OSS to AnalyticDB for MySQL (ADB) for query and analysis. For more information, see Import backup data from an instance that uses cloud disks to AnalyticDB for MySQL.
You can use the backup download feature and the mysqldump tool to restore ApsaraDB RDS for MySQL logical backup files to a self-managed database for an instance with high-performance local disks.
You can use the backup download feature for an instance with high-performance local disks to restore an ApsaraDB RDS for MySQL physical backup file to a self-managed database.
You can also use API operations to download backups. The following API operations are available:
CreateDownload - Create a download task (for instances that use cloud disks)
DescribeDownloadTask - Query the list of download tasks (for instances that use cloud disks)
DescribeBackups - View the list of backup sets for an ApsaraDB RDS instance
DescribeBinlogFiles - View the binary log (Binglog) files of an ApsaraDB RDS instance
To download backups for other database engines, see the following topics:
FAQ
For more information about downloading backups, see FAQ about backup downloads.