All Products
Search
Document Center

PolarDB:Download backup files

Last Updated:May 21, 2025

PolarDB allows you to download cluster backup files to your local device for long-term backup storage, historical data queries, backup transfers (such as to OSS), and audit requirements.

Note

The downloaded backup data cannot be directly used to restore to a PolarDB for MySQL cluster. You can restore the downloaded backup files to a self-managed MySQL database.

Release date

November 24, 2023

Note

This feature is in canary release and will be officially launched soon.

Billing

The backup file download feature supports downloading using a URL (temporarily stored in DBS built-in storage) or transferring to your OSS. The billing methods differ depending on the download destination:

Note
  • If you fail to download backup files, no fees are incurred.

  • You can go to the PolarDB console, and in the cluster's Configuration And Management > Backup And Recovery > Backup Download List, view the Backup Calculation Data Volume Of Current Month and Outbound Traffic Over Internet Of Current Month.

Storage fees

Backup set conversion fees

Whether the download destination is URL or OSS, conversion fees are charged when converting backup sets to SQL, CSV, Parquet, or CSV-with-header formats, with no free quota. The specific billing standard is $0.03125/GB.

Traffic fees

  • URL:

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

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

    Note

    We recommend that you purchase a subscription network plan to offset the network traffic fees generated by downloading backups over the Internet. The larger the network plan capacity, the higher the discount.

  • OSS: Transferred to your OSS. For specific traffic fees, see Object Storage Service (OSS) traffic fees.

Prerequisites

  • Cluster: Only Enterprise Edition clusters in the Cluster series support the backup file download feature.

  • Region: 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, US (Silicon Valley), US (Virginia), and Germany (Frankfurt).

    Note

    The feature will be available in other regions soon.

  • Others:

    • The RAM user that you want to use to log on to your RDS instance has permissions to download backup files. To grant permissions to a RAM user, see RAM user permissions.

    • Backup data is not encrypted. Encrypted PolarDB clusters do not support downloading backup files.

Limits

  • Only most table structures can be exported. Some structure information is not supported for export:

    • Supported for export: column information, primary key index, non-primary key indexes, unique index, partitioned table information, table engine, and table-level or database-level character sets and collations.

    • Not supported for export: expression indexes, foreign keys, generated columns, hidden columns, views, functions, stored procedures, system variables, and triggers.

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

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

  • The exported files do not include the following system databases:

    information_schema, mysql, performance_schema, sys, __recycle_bin__

  • If you select OSS as the download destination, the OSS storage class must be Standard. To convert the storage class, see Storage class conversion.

    Note

    You need to manually create an OSS bucket. If you have already created a bucket for storing backup files, you can ignore this step.

  • The backup file download feature only supports downloading data from level-1 backups, not from level-2 backups.

  • If the cluster has enabled cold data archiving, downloading archived cold data is not supported.

Procedure

(Recommended) Console operations

  1. Log on to the PolarDB console, click Clusters in the left-side navigation pane, select the region where the cluster is located, and click the target cluster ID to go to the cluster details page.

  2. In the left-side navigation pane, click Configuration And Management > Backup And Restoration.

  3. In the Data Backup list, click Cluster Backup Download in the Actions column of the target backup set.

    image

    Note
    • By default, the PolarDB 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 the Cluster Backup Download button is not available in the console, check whether your cluster product version or region meets the prerequisites.

  4. Under the Download Time Point And Backup Set workflow, select Download By Time Point or Download By Backup Set, and click Next in the lower-left corner of the page.

    image.png

  5. Under the Download Instance And Database/Table workflow, click Next in the lower-left corner of the page. This is fixed as Instance Download.

  6. Under the Download Destination And Format workflow, select the download destination and format, and complete the configuration.

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

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

    • The backup download task will incur corresponding fees. For details, see Billing.

    (Recommended) OSS

    When the download destination is OSS, data is written directly to your OSS. You can delete it as needed after use.

    1. Enter your OSS Bucket Name and directory prefix (such as xx/xx).

      Note
      • You need to manually create an OSS bucket. If you have already created a bucket for storing backup files, you can enter it directly.

      • The OSS storage class must be Standard. To convert the storage class, see Storage class conversion.

    2. Select the download format. Currently, you can set the download format to CSV, SQL, Parquet, or CSV-with-header. You can choose based on your business requirements.

    3. Read and check the relevant information, and click Complete. The page automatically jumps to the Backup Download List tab, where you wait for the task to complete.

      Note
      • The backup file download feature requires authorization for the DBS service to access your cloud resources. If you have not previously authorized access permissions, follow the console prompts to click Authorize > Confirm Authorization. After the permissions are granted, configure the parameters for the advanced download task.

      • Because the computation conversion requires competing for computing resources on the service side, temporary resource allocation failures may occur, leading to download failures. Additionally, some unsupported special data formats may also cause download failures. If your download task fails, try again or contact DBS technical support.

      • No fees are generated for failed tasks.

    4. View backup files: If the status of the download task is Successful, the download is complete, and you can view the files in the corresponding OSS bucket.

    URL

    When the download destination is URL, the system temporarily stores the converted data in DBS built-in storage. No storage fees are charged for this process.

    Note

    URL downloads involve data packaging, which requires additional waiting time. The duration of this packaging process is largely dependent on the logical size of the backup set. If the logical backup size is large (such as over 1 TB), we recommend downloading to OSS.

    1. Select the download format. Currently, you can set the download format to CSV, SQL, Parquet, or CSV-with-header. You can choose based on your business requirements.

    2. Read and check the relevant information, and click Complete. The page automatically jumps to the Backup Download List tab, where you wait for the task to complete.

      Note
      • The backup file download feature requires authorization for the DBS service to access your cloud resources. If you have not previously authorized access permissions, follow the console prompts to click Authorize > Confirm Authorization. After the permissions are granted, configure the parameters of the backup download task.

      • Because the computation conversion requires competing for computing resources on the service side, temporary resource allocation failures may occur, leading to download failures. Additionally, some unsupported special data formats may also cause download failures. If your download task fails, try again or contact DBS technical support.

      • No fees are generated for failed tasks.

    3. View backup files: If the status of the download task is Successful, the download is complete, and you can click Generate Link in the Download Destination column, set the link Validity Period, and click Generate Link to download the backup data through the generated internal or external network link.

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

      • Completed tasks expire after three days (the download link will expire), and the corresponding data will be cleaned up after the task expires (cleanup is automatically executed some time after the task expires). 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 backup files, additional traffic may be generated and you may be charged additional fees. Proceed with caution. For specific download methods, see Download commands.

API operations

  1. DescribeDownloadSupport: Checks whether your cluster supports the backup file download feature.

    Note

    If the API returns that the feature is not supported, check whether your cluster product version or region meets the prerequisites.

  2. CreateDownload: Creates a backup file download task.

    Note
    • The backup file download feature requires authorization for the DBS service to access your cloud resources (AliyunDBSDefaultRole permission). If you have not previously authorized access permissions, you can first follow the console operations to authorize.

    • When TargetType is OSS, note that you need to manually create the corresponding bucket, and the OSS storage class must be Standard.

    • When TargetType is URL, you need to retain the returned parameter TaskId (task ID) to obtain the download link.

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

    • The backup download task will incur corresponding fees. For details, see Billing.

  3. (Optional) DescribeDownloadTask: Views the backup file download task information for the current cluster, including the download task status.

  4. Get backup files:

    • When the download destination type is OSS, the system writes the data directly to your OSS, and you can view it in the corresponding bucket.

    • When the download destination type is URL, you can use DescribeDownloadBackupSetStorageInfo to obtain the download link.

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

      • Completed tasks expire after three days (the download link will expire), and the corresponding data will be cleaned up after the task expires (cleanup is automatically executed some time after the task expires). 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 backup files, additional traffic may be generated and you may be charged additional fees. Proceed with caution. For specific download methods, see Download commands.

FAQ

Can I cancel an ongoing backup download task?

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

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

When using downloaded backup files to restore to a local MySQL database, I get the error ERROR 1148 (42000): The used command is not allowed with this MySQL version.

Run the query script show variables like 'local_infile'; on MySQL. If the result is OFF, run the following statement to enable file import: set global local_infile = 1;. After the preceding operations are complete, run the import script again.

Why is the backup size shown in the console different from the actual downloaded backup file size?

The downloaded backup files are compressed and generally smaller than the backup size displayed in the console. You can restore the files to check if the data is complete.

Can the downloaded backup files be directly restored to other PolarDB clusters?

Currently, you cannot directly restore downloaded backup files to other PolarDB clusters. You can first restore the backup files to a self-managed MySQL database, and then use DTS to migrate from the self-managed MySQL to PolarDB for MySQL.

Appendix

RAM user permissions

The backup file download feature's authentication capability relies on RAM's permission management. You can configure permissions for your account to obtain download URLs through RAM.

Grant permissions to download backup files to a RAM user

If you cannot use the download backup feature normally (such as creating or querying download tasks), check whether your RAM user has added Data Disaster Recovery management permissions (AliyunDBSFullAccess). For information about how to grant permissions, see Grant permissions to a RAM user.

Prevent a RAM user from obtaining backup file download URLs

If your RAM user needs to have backup and restoration usage permissions but should be prevented from obtaining backup file download URLs, you can create a custom policy to prevent the RAM user from calling the API to obtain download URLs. The reference script is as follows:

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Deny",
            "Action": "dbs:DescribeDownloadBackupSetStorageInfo",
            "Resource": "*"
        }
    ]
}

After creating the custom policy, grant it to your RAM user. Then, the RAM user cannot obtain download URLs.

Allow read-only RAM users to download backup files

For security reasons, if a RAM user has read-only access to POLARDB databases (AliyunPolardbReadOnlyAccess), this read-only RAM user cannot download backup files.

In this case, if the RAM user needs permission to download backup files, you can grant the RAM user read-only access to Data Disaster Recovery (AliyunDBSReadOnlyAccess). After authorization, the RAM user can view the download links for created backup download tasks. For information about how to grant permissions, see Grant permissions to a RAM user.

image.png

Download commands

Note
  • If the download speed is slower than 64 KB per second, the download may be interrupted. We recommend that you ensure optimal network status when you download a backup file.

  • If you download backup files to an ossfs mount disk, you generally need to adjust the ossfs multipart_size parameter. This parameter supports a maximum file size of 100 GB by default. If the downloaded backup file is larger than 100 GB, the download will fail. For details about ossfs overview and parameter configuration, see ossfs and Mount options.

  • We recommend that you use the wget and curl commands provided in this topic to download backup files. 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 "backup file download URL" -O destination path and file name > download output log to corresponding file &

Parameter description

Parameter

Description

nohup

Prevents the download from being interrupted due to accidental copy operations or terminal disconnection, and automatically exits the process when the download is complete.

-c

Enables resumable uploads.

-t

Number of retry attempts. Setting it to 0 means unlimited retries.

-O

Specifies the destination path and file name.

Example

nohup wget -c -t 0 "http://dbs-xxx.aliyuncs.com/xxx.tar.gz?xxx" -O /backup/examplebackup.tar.gz > /tmp/download.log &

curl

nohup curl -C - --retry 10 "backup file download URL" -o custom file name > download output log to corresponding file &

Parameter description

Parameter

Description

nohup

Prevents the download from being interrupted due to accidental copy operations or terminal disconnection, and automatically exits the process when the download is complete.

-C -

Supports resumable uploads.

--retry

Number of retry attempts. Setting it to 10 means 10 retries.

-o

Specifies the destination path and file name.

Example

nohup curl -C - --retry 10 "http://dbs-xxx.aliyuncs.com/xxx.tar.gz?xxx" -o /backup/examplebackup.tar.gz > /tmp/download.log &