All Products
Search
Document Center

ApsaraDB RDS:Download backup files

Last Updated:Apr 30, 2025

This topic describes how to download the backup files of an ApsaraDB RDS for MySQL instance. You can use the backup files in the scenarios such as long-term retention of backup files, backup queries, data migration, and audit.

Usage notes

Important

The backup download task cannot be canceled after it is started. Before you download the backup files of your RDS instance, you must select a download method based on your business requirements.

  • The data of the backup files that you download cannot be used to directly restore your RDS instance. For more information about how to restore an RDS instance, see Restoration.

  • The manual backup files can be downloaded only after the manual backup task is complete. You can click the image icon in the upper-right corner of the required page to view the status of the manual backup task on the Task Center page.

Scenario

Description

  • Migrate the data of your RDS instance to a different RDS instance or to a self-managed MySQL instance

  • Restore the data of your RDS instance from backup files

Use one of the following methods:

  • Query the data that exists in your RDS instance at a specific point in time

  • Query the data in the backup files of your RDS instance

Use one of the following methods:

  • Restore the backup file to a pay-as-you-go or serverless RDS instance. After you query the data, release the pay-as-you-go or serverless RDS instance. For more information, see Restore full data.

  • Download the backup files, restore the backup files to a self-managed MySQL instance, and then query the data from the self-managed MySQL instance based on the descriptions in this topic.

  • Save the backup files of your RDS instance to your computer

  • Download the backup files of your RDS instance and use the backup files for auditing

Use one of the following methods:

Upload the backup files to an OSS bucket

Backup files are stored in the provisioned backup storage and do not consume the storage capacity of your RDS instance. If you want to store the backup files of your RDS instance in an OSS bucket, you can use one of the following methods:

  • If your RDS instance that uses cloud disks meets the requirements, you can create an advanced download task and configure the task to download the backup files of your RDS instance to an OSS bucket by following the instructions provided in this topic. If your RDS instance that uses cloud disks does not meet the requirements or your RDS instance uses Premium Local SSDs, you can download the backup files of your RDS instance by following the instructions provided in this topic and then upload the backup files to an OSS bucket. For more information, see How do I upload large objects to OSS?

  • Use Database Backup (DBS) to back up your RDS instance. Make sure that you select an OSS bucket as your storage. For more information, see Configure a backup schedule. You can use the Data Disaster Recovery feature to restore the backup data from the OSS bucket to your RDS instance.

Retain the backup files for a long period of time

Configure the system to automatically download the backup files

Download the binary logs

  • RDS instances that use cloud disks: After you enable the log backup feature for an RDS instance that uses cloud disks, binary logs are uploaded or replicated to the backup storage in real time and stored as log backup files. The log backup feature is enabled by default. You can download binary logs at the specific point in time. For more information, see the RDS instances that use cloud disks table in Download methods.

  • RDS instances that use Premium Local SSDs: For more information about how to download the binary logs of the instances, see the RDS instances that uses Premium Local SSDs table in Download methods.

Billing rules

If your RDS instance uses Premium Local SSDs and you download the backup files of the RDS instance, you are charged fees for Internet traffic generated for the download. If your RDS instance uses cloud disks and you download the backup files of the RDS instance, you are charged fees for file conversion and Internet traffic generated for the download.

Traffic fee

  • Downloads over an internal network: You are not charged for the traffic that you consume.

  • Downloads over the Internet: After the free quota of 500 GB per instance-month is exhausted, you are charged for the excess traffic that you consume based on the pay-as-you-go billing method. Fees are deducted from your account on a daily basis. For more information, see Network traffic fees.

Note
  • You can download the backup files of an RDS instance over an internal network or the Internet regardless of the storage type of the RDS instance.

  • When you start a task to download the snapshot backup file of an RDS instance that uses cloud disks, the system converts the backup file and generates a download task. If the task is not complete, the download URL cannot be obtained. In this case, you are not charged for Internet traffic. In-progress tasks and failed tasks are considered not complete. After the task is complete, you are charged for the traffic generated when you download the backup file by using the URL.

  • When you download the physical backup file of an RDS instance that uses local disks, the system does not convert the backup file and directly provides you with the download URL. You are charged for the traffic generated when you download the backup file by using the URL.

  • To view the volume of traffic that you consumed to download backup files over the Internet, you can log on to the ApsaraDB RDS console, find your RDS instance, and then click the ID of the instance to go to the Basic Information page of the RDS instance. Then, you can view the Backup Downloads parameter in the Usage Statistics section of the page.

  • We recommend that you purchase a subscription network plan to offset the fee for the Internet traffic that is used to download the backup files. A large capacity of a network plan indicates a high discount. For more information, see Use network plans.

Backup set conversion fee

If you use the advanced download feature, the snapshot backup files are converted into CSV files with or without headers, SQL, or Parquet files, and you are charged for conversions. No free quota is provided for backup set conversion. The following table describes the unit prices for backup set conversion in different regions.

Region

Unit price (USD per GB)

Public cloud

0.03125

Note

When you start a task to download the snapshot backup file of an RDS instance that uses cloud disks, the system generates a task to convert the backup file. If the conversion task fails, you are not charged for backup set conversion.

Download methods

RDS instances that use cloud disks

You can create an advanced download task by point in time or backup set. You can set the Download Destination parameter to URL or directly upload the downloaded data to your OSS bucket to facilitate data analysis and offline archiving.

Prerequisites

  • The RDS instance meets the following requirements:

    • The RDS instance runs MySQL 8.0 or MySQL 5.7. Serverless RDS instances are supported.

    • The RDS instance uses ESSDs or Premium ESSDs.

    Note
    • You can go to the Basic Information page of your RDS instance to obtain the preceding information.

    • If you enable the data archiving feature for your RDS instance that uses Premium ESSDs, the advanced download feature is not supported for the RDS instance. If you download backup files from the instance, the download task fails.

  • Your RDS instance resides in one of the following Alibaba Cloud public cloud 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), and Germany (Frankfurt).

    Note

    The feature will be available in other regions soon.

  • The RDS instance runs a minor engine version later than 20201031. For more information, see Update the minor engine version.

    Important

    If the minor engine version of your RDS instance meets the requirements but you cannot use the advanced download feature in the ApsaraDB RDS console, we recommend that you check your hardware. If the Download Instance Backup button is dimmed, the advanced download feature is unavailable. The advanced download feature is not supported for some RDS instances due to hardware limits. If you want to use the advanced download feature, you must check whether the database proxy feature is enabled for your RDS instance and then update the minor engine version of the instance to resolve this issue. For more information, see Enable the database proxy feature. The following list describes the details:

    • If the database proxy feature is disabled, directly update the minor engine version. After the update is complete, go to the ApsaraDB RDS console to check whether the Download Instance Backup button is available. For more information, see Update the minor engine version.

    • If the database proxy feature is enabled, you cannot directly update the minor engine version to resolve this issue. In this case, disable the database proxy feature and then update the minor engine version. After the update is complete, go to the ApsaraDB RDS console to check whether the Download Instance Backup button is available. For more information, see Disable the dedicated proxy feature and Update the minor engine version. For subsequent use, you can enable the feature based on your business requirements.

  • The disk encryption feature is disabled for your RDS instance. If the RDS instance uses cloud disks and cloud disk encryption is enabled for the RDS instance, the advanced download feature is not supported.

  • The Resource Access Management (RAM) user that you want to use to log on to your RDS instance is granted the permissions to download backup files. For more information about how to grant permissions to a RAM user, see Grant backup file download permissions to a RAM user with read-only permissions.

Limits on features

  • The advanced download feature allows you to export most schemas. Some schemas cannot be exported.

    • You can export column information, primary key indexes, non-primary key indexes, unique indexes, partition table information, table engines, and table-level or database-level character sets and character collations.

    • You cannot export expression indexes, foreign keys, generated columns, hidden columns, views, functions, stored procedures, system variables, or triggers.

  • The advanced download feature does not support fields of spatial data types. If your RDS instance contains fields of the following spatial data types, backup file conversions fail:

    GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION

  • The CSV files that you export from your RDS instance do not contain the following system databases:

    information_schema, mysql, performance_schema, sys, and __recycle_bin__

  • If you set the Download Destination parameter to OSS, only the Standard storage class is supported. For more information about how to change the storage class, see Convert storage classes.

Procedure

  1. Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the instance ID.

  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup and Restoration page, click Base Backups.

    • Download log backup files

      On the Log Backup tab, find the log backup file that you want to download and click Download in the Actions column of the file. Obtain the internal URL or public URL to download the file.

    • Download data backup files

      1. On the Data Backup tab, find the backup set that you want to download and click Download Instance Backup File in the Actions column.

        Note
        • By default, the ApsaraDB RDS console displays the backup sets that are generated over the most recent eight days. If you want to view the backup sets that are generated eight days ago, you must change the default time range.

        • If Download Instance Backup File is not displayed, check whether the major engine version or region of the RDS instance meets the requirements that are described in Prerequisites.

      2. In the Point in Time and Backup Set step of the wizard, select Download by Point in Time or Download by Backup Set and then click Next.

        Note

        The Download by Point in Time option is available only when the log backup feature is enabled for your RDS instance.

      3. In the Instance, Database, and Table step of the wizard, click Next.

        Note

        By default, Instance Download is selected.

      4. In the Destination and Format step of the wizard, configure the Download Destination parameter and complete relevant configurations.

        Important
        • We recommend that you set the Download Destination parameter to OSS to ensure efficiency.

        • If the Download Destination parameter is set to URL, internal and public URLs are generated after the download task is complete. You can select a URL to download the backup data based on your business requirements.

        • The backup download task cannot be canceled after it is started.

        Set the Download Destination parameter to OSS (recommended)

        Note

        If you set the Download Destination parameter to OSS, data is directly downloaded to your OSS bucket. You can use and delete the data based on your business requirements.

        1. Configure the Bucket Name and Directory Prefix parameters.

        2. Configure the Download Format parameter.

          Note
          • You can download the backup files in one of the following formats: CSV without headers, CSV with headers, SQL, and Parquet.

          • If you do not have the permissions to access OSS resources, follow the instructions in the console and click Authorize and then Confirm Authorization Policy. After the permissions are granted, configure the parameters for the advanced download task.

        3. Read and select the required content and click Complete.

        4. Go to the Backup Download tab.

          Wait until the Status parameter of the task changes from Running to Finished. You can view and use the downloaded file in the specified OSS bucket.

          Important
          • Computing resources are competed to convert the downloaded backup sets. As a result, temporary resource allocation may fail, and the download task fails. The download task may also fail due to unsupported special data formats. If your download task fails, try again or contact the technical support from the Data Disaster Recovery team.

          • No fees are generated for failed tasks.

        Set the Download Destination parameter to URL

        Note

        If you set the Download Destination parameter to URL, the downloaded data is temporarily stored in the built-in storage of DBS. No storage fees are generated. For more information, see Built-in storage and OSS.

        1. Configure the Download Format parameter, read and select the required content, and then click Complete.

          Note

          You can download the backup files in one of the following formats: CSV without headers, CSV with headers, SQL, and Parquet.

        2. Wait until the Status parameter of the task changes from Running to Finished.

          Important
          • Computing resources are competed to convert the downloaded backup sets. As a result, temporary resource allocation may fail, and the download task fails. The download task may also fail due to unsupported special data formats. If your download task fails, try again or contact the technical support from the Data Disaster Recovery team.

          • No fees are generated for failed tasks.

        3. Click Generate Link in the Download Destination column.

        4. In the Generate Link dialog box, configure the Validity Period parameter and click Generate Link. Then, you can download backup data by using the generated URL. For more information, see Appendix: Download commands.

          • Internal URL: If your virtual private cloud (VPC)-type Elastic Compute Service (ECS) instance can communicate with the RDS instance over an internal network, you can log on to your ECS instance and use the internal URL to download the log backup file. This method is faster and more secure.

          • Public URL: If the RDS instance cannot be connected over an internal network, you can use the public URL to download the backup file.

          Important
          • You can obtain the download URL within three days after the download task is complete. The validity period of a download URL can be set to 5 minutes to 1 day. The default validity period is 2 hours.

            After a download task is complete, the download task and the download URL of the task expire three days later. After the expiration, the data of the download task is automatically cleared within a specific period of time. If you do not retain the data within the specified period of time but want to use the data, you must initiate a new download task and obtain a new download URL.

          • We recommend that you save the URL at the earliest opportunity and keep the URL confidential.

          • If you use a third-party download tool to download the backup set, additional download traffic may be generated. As a result, you may be charged additional fees. Proceed with caution.

          • When you perform an advanced download, you are charged a file conversion fee and a traffic consumption fee. For more information, see Billing.

RDS instances that use Premium Local SSDs

Prerequisites

  • The RDS instance uses Premium Local SSDs.

    Note

    You can go to the Basic Information page of the RDS instance to view the preceding information.

  • The RAM user that you want to use to log on to your RDS instance is granted the permissions to download backup files. For more information about how to grant permissions to a RAM user, see Grant backup file download permissions to a RAM user with read-only permissions.

Procedure

  1. Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the instance ID.

  2. In the left-side navigation pane, click Backup and Restoration. On the page that appears, click the Base Backups tab.

  3. Click the Data Backup tab or the Log Backup tab.

  4. Find the backup set that you want to download. In the Actions column, click Download Instance Backup File on the Data Backup tab or Download on the Log Backup tab.

    Note

    By default, the ApsaraDB RDS console displays the backup sets that are generated over the most recent eight days. If you want to view the backup sets that are generated eight days ago, you must change the default time range.

  5. In the dialog box that appears, click I have learned the billing rules for backup file and I want to download backup files over the Internet or copy the URL from which you can download the backup file.

    • Copy Internal URL: If you want to connect your virtual private cloud (VPC)-type ECS instance to the RDS instance over an internal network, you can log on to your Elastic Compute Service (ECS) instance and use the internal URL to download the backup file. This method is faster and more secure.

    • Copy Public URL: If the RDS instance cannot be connected over an internal network, you can use the public URL to download the log backup file.

    Note
    • Select I have learnt the billing rules for backup file download. If you use the public URL to download the backup file, you are charged for the excess Internet traffic that you consume. For more information, see Billing.

    • The URLs that can be used to download backup files are valid for only 1 hour. We recommend that you download the URLs at the earliest opportunity. If the download URLs expire, you can refresh the page to obtain the latest download URLs.

    • The download tasks that are run before the URLs expire are not affected after the URLs expire.

    • For more information about how to use the internal or public URL to download backup files, see Appendix: Download commands. If you do not run commands to download backup files, you can directly copy the public URL and enter the public URL in the browser to download the backup files.

    • If you use the internal URL to download the backup files, make sure that the server to which you log on and the RDS instance reside in the same VPC. If the server and the RDS instance reside in VPCs of different regions or if the server resides in the classic network and the RDS instance resides in a VPC, you cannot download the backup files by using the internal URL on the server.

    • The log backup files that are described in this section are the log backup files that are stored on the RDS instance. For more information about how to obtain the log files, see How do I use the mysqlbinlog command to view the binary logs of an ApsaraDB RDS for MySQL instance?.

    • If the RDS instance runs RDS High-availability Edition or RDS Enterprise Edition, the primary RDS instance and the secondary RDS instances generate log backup files. You can view the IDs of the primary RDS instance and the secondary RDS instances on the Service Availability page.

    • If you want to restore the data of the RDS instance to a self-managed MySQL instance, the point in time at which the used data backup file is generated must be within the restorable time range that is supported by the log backup file. In addition, the log backup file and the data backup file must have the same instance ID.

Appendix: Download commands

This section describes how to use commands such as wget and curl to obtain backup data by using the download URL.

Note
  • If the speed of a download is lower than 64 KB per second, the download may be interrupted. When you download a backup file, make ensure that the network status is optimal.

  • If you want to download a backup file to a disk that is attached by using ossfs, you must adjust the value of the multipart_size parameter for ossfs. The maximum value of this parameter is 100 GB. If the size of the backup file that you want to download exceeds 100 GB, the download fails. For more information about ossfs and its parameter settings, see ossfs and Common options.

  • We recommend that you use the commands, such as wget and curl, that are provided in this topic to download a data backup file. If you use a third-party tool to download a backup file, the backup file may be downloaded multiple times. As a result, the amount of data that is downloaded is greater than the size of the backup file, and you may be charged for the traffic that is consumed to download the excess amount of data over the Internet.

wget

nohup wget -c -t 0 "URL that is used to download the backup file" -O Path and name of the downloaded backup file > Name of file to which monitoring logs are saved &

The following table describes the parameter in the preceding command.

Parameter

Description

nohup

Prevents interruptions to the download and specifies that the process automatically exits after the download is complete. If you accidentally replicate data or disconnect your database client during the download, the download is interrupted.

-t

Specifies the number of retries. If you set the value to 0, no limits are imposed on the number of retries.

-c

Enables resumable uploads.

-O

Specifies the save path and name of the backup file that you want to download.

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 "URL that is used to download the backup file" -o Path and name of the downloaded backup file> File to which the monitoring logs are saved &

The following table describes the parameter in the preceding command.

Parameter

Description

nohup

Prevents interruptions to the download and specifies that the process automatically exits after the download is complete. If you accidentally replicate data or disconnect your database client during the download, the download is interrupted.

--retry

Specifies the number of retries when the task fails. If you set the value to 10, 10 retries are allowed.

-C -

Enables resumable uploads.

-o

Specifies the save path and name of the backup file that you want to download.

Example:

nohup curl -C - --retry 10 "https://dbs-****.aliyundoc.com/****.tar.gz****" -o examplebackup.tar.gz > /tmp/download.log &
Note

For more information about how to obtain the download URL of a backup file, see Download methods.

References

FAQ

Can I upload the backup files of my RDS instance to an OSS bucket?

Yes, you can create an advanced download task for your RDS instance that uses cloud disks by point in time or backup set. Then, you can directly upload the downloaded backup files to your OSS bucket. For more information, see Download methods. You can also download the backup files of your RDS instance that uses cloud disks or local disks to your computer. Then, you can upload the downloaded backup files to your OSS bucket.

Does ApsaraDB RDS limit bandwidth when I download the backup files of my RDS instance over the Internet?

ApsaraDB RDS does not impose limits on bandwidth. The speed of downloading backup files over the Internet depends on the bandwidth of your server. If the bandwidth of your server is limited, the speed of downloading backup files may be affected. If the amount of bandwidth that you consume to download backup files over the Internet exceeds the free quota, you are charged for the excess bandwidth that you consume. For more information, see Billing rules.

How do I use the data backup files and log backup files that I downloaded?

If your RDS instance uses local disks, you can restore the data of the backup files that you downloaded by using the standard download feature to a self-managed instance. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance from a physical backup file to a self-managed MySQL database or Restore the data of an ApsaraDB RDS for MySQL instance from a logical backup file to a self-managed MySQL instance.

Can I change the default format of the physical backup files of an RDS instance that uses Premium Local SSDs from qp.xb to the .gz format?

  • If the restoration feature for individual databases and tables is enabled for the RDS instance, the backup files of the RDS instance must be compressed in the qp.xb format. For more information, see Restore individual databases and tables.

  • If the restoration feature for individual databases and tables is disabled for the RDS instance, you can call the ModifyBackupPolicy operation to change the compression format of the backup files of the RDS instance from qp.xb to tar.gz. For more information, see Restore individual databases and tables and ModifyBackupPolicy. The operation changes only the compression method of the backup files of the RDS instance.

My RDS instance uses cloud disks. What do I do if the ERROR 1148 (42000): The used command is not allowed with this MySQL version error message appears when I restore the data of a backup file that I downloaded by using the advanced download feature to a self-managed MySQL instance?

Execute the SHOW VARIABLES LIKE 'local_infile'; statement on the self-managed MySQL instance. If OFF is displayed in the output, execute the SET statement to set the global local_infile parameter to 1 to enable file import. After you perform the preceding operations, rerun the import script.

After I download a backup file, why is the size of the backup file that is displayed in the ApsaraDB RDS console inconsistent with the size of the downloaded backup file?

The downloaded backup file is compressed. As a result, the size of the downloaded backup file is smaller than the file size that is displayed in the ApsaraDB RDS console. You can check the data integrity after the data is restored from the backup file. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance to a self-managed MySQL instance by using snapshot backup files.

Can I directly restore the backup files that are downloaded from the ApsaraDB RDS console to another RDS instance?

No, you cannot directly restore the backup files that are downloaded from the ApsaraDB RDS console to another RDS instance. If you want to restore the backup files to another RDS instance, perform the following operations: Restore the backup files to a self-managed MySQL instance and use DTS or mysqldump to migrate data from the self-managed MySQL instance to the required RDS instance. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance from a physical backup file to a self-managed MySQL database, Migrate data from a self-managed MySQL database to an ApsaraDB RDS for MySQL instance, and Use the mysqldump extension to migrate data from a self-managed MySQL instance to an ApsaraDB RDS for MySQL instance.

Can I cancel an ongoing backup download task?

No, you cannot cancel a backup download task after it is started.

What do I do if the backup files of my RDS instance are not completely displayed in the backup list?

You can perform the following operations:

  1. Restore full data to a new RDS instance. For more information, see Restore full data.

  2. Check which table or data is lost on the new RDS instance.

  3. Export the lost table or data from the original RDS instance.

  4. Use DTS to synchronize the exported table or data to the new RDS instance.

When I use the internal endpoint to download backup files of my RDS instance, the "ERROR 403: Forbidden." error message is displayed. What do I do?

  1. Check whether the conditions to connect to the RDS instance over an internal network are met. If the conditions are not met, modify the configurations to make sure that the ECS instance and RDS instance can communicate with each other over a VPC.

  2. Check whether the format of the download command is valid. For example, check whether the download URL includes Chinese double quotes. For more information, see Appendix: Download commands.

If your RDS instance cannot be connected over an internal network, you can use the public endpoint to download backup files.

How do I delete the expired backup files from the backup file list?

You cannot delete the expired backup files from the backup file list. These backup files do not affect the usage of the RDS instance.

Can I directly import the downloaded backup file to my self-managed database?

No, you cannot directly import the physical backup file to your self-managed database. If you want to import a backup file to your self-managed database, we recommend that you manually create a logical backup file, download the backup file, and then import the backup file to your self-managed database.

What do I do if the "ERROR 504:Gateway Time-out." error is reported when I run the wget command to download backup files?

When you run the wget command, we recommend that you add the --read-timeout=300 --connect-timeout=300 parameter to the command.

Does the download of backup files occupy the bandwidth of the current instance?

No, the download of backup files does not occupy the bandwidth of the current instance no matter whether you download the files over the internal network or Internet. If you download backup files over the Internet, you are charged outbound traffic fees and the download speed depends only on the bandwidth of the local network.

After I run the backup commands to download the backup files of my RDS instance, why are garbled characters displayed in the files?

After you run the backup commands to download the backup files of your RDS instance to your computer or ECS instance, you must run the tar -izxvf <Name of the downloaded package>.tar.gz -C <Directory to store the files that are obtained from the downloaded package> command to decompress the package and view the files in the specified folder.

How are the downloaded backup files named?

Downloaded backup files are named according to the host ID of the instance and the download time of the files.

For more information about backup download, see How do I troubleshoot issues about backup downloads of an ApsaraDB RDS instance?