All Products
Search
Document Center

PolarDB:Download backup files

Last Updated:Dec 31, 2025

PolarDB lets you download backup files from cluster backup sets to your local system. You can use these files for long-term storage, historical data queries, transferring backups to other services such as Object Storage Service (OSS), and auditing.

Note

You cannot directly restore downloaded backup data 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

The backup file download feature is in phased release and will be rolled out gradually.

Billing

The backup file download feature lets you download files using a URL or by transferring them to your Object Storage Service (OSS). Files downloaded using a URL are temporarily stored in DBS Storage. The billing method depends on the download destination, as described in the following sections:

Note
  • If a download task fails, no fees are charged.

  • Go to the PolarDB console. Under Settings and Management > Backup and Restoration > Backup Download List, you can view the Monthly Backup Compute Data Volume and Monthly Outbound Internet Traffic for your cluster.

Storage fees

  • URL: Files are temporarily stored in DBS Storage. No storage fees are charged.

  • OSS: Files are transferred to your OSS. For more information about storage fees, see Object Storage Service storage fees.

Backup set conversion fees

Regardless of whether the download destination is a URL or OSS, conversion fees are charged for converting backup sets to SQL, CSV, Parquet, or CSV-with-header format. No free quota is available for format conversion. The pricing rate is USD 0.03125 per GB.

Traffic fees

  • URL:

    • Internal network download: Free.

    • Internet download: A free quota of 500 GB per month is provided for each cluster. Traffic that exceeds the free quota is billed on a pay-as-you-go basis. Charges are calculated daily based on the amount of data downloaded. For more information about pricing, see Network fees.

    Note

    You can purchase a subscription network plan to offset the network traffic fees for downloading backups over the Internet. A network plan with a larger capacity provides a higher discount.

  • OSS: Files are transferred to your OSS. For more information about traffic fees, see Object Storage Service traffic fees.

Prerequisites

  • Cluster: Only Enterprise Edition clusters of 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 must have permissions to download backup files. For more information about how to grant permissions to a RAM user, see RAM user permissions.

    • The backup data is not encrypted. You cannot download backup files from encrypted PolarDB clusters.

    • A cluster or instance can have only one download task at a time. You cannot start a new task if a previous task is running or has failed.

Limits

  • You can export most table structures. However, some structural information cannot be exported:

    • 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.

  • Fields of spatial data types are not supported. If the data contains fields of the following types, the conversion task fails:

    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 bucket must use the Standard storage class. To convert the storage class, see Convert storage classes.

    Note

    You must create an OSS bucket manually. If you have already created a bucket to store backup files, ignore this step.

  • The backup file download feature supports downloading only level-1 backup data. It does not support downloading level-2 backup data.

  • If cold data archiving is enabled for the cluster, you cannot download backup sets.

  • If the names of the databases or tables to be downloaded contain a forward slash (/), the task fails.

Procedure

(Recommended) Use the console

  1. Log on to the PolarDB console. In the navigation pane on the left, click Clusters. Select the region where the cluster is located, and then click the ID of the target cluster.

  2. In the navigation pane on the left, click Settings and Management > Backup and Restoration.

  3. On the Data Backup List tab, find the target backup set and click Download Cluster Backup in the Actions column.

    image

    Note
    • By default, the console displays backup data from the last 8 days. To view backups older than 8 days, change the time range.

    • If the Download Cluster Backup button is not displayed, check whether your cluster's edition or region meets the prerequisites.

  4. In the Download Point-in-time and Backup Set step, select Download by Point-in-time or Download by Backup Set, and then click Next at the bottom left of the page.

    image.png

  5. In the Download Instance and Database/Table step, click Next at the bottom left of the page. Instance Download is selected by default.

  6. In the Download Destination and Format step, select the download destination and format, and complete the configuration.

    Important
    • We recommend that you select OSS as the download destination because it is faster.

    • You cannot cancel a backup download task after it starts.

    • Backup download tasks incur fees. For more information, see Billing.

    (Recommended) OSS

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

    1. Enter the OSS bucket name and a directory prefix, such as xx/xx.

      Note
      • You must create an OSS bucket manually. If you have already created a bucket to store backup files, you can enter its name directly.

      • The storage class of the OSS bucket must be Standard. For more information about how to convert the storage class, see Convert storage classes.

    2. Select a download format. You can set the download format to CSV, SQL, Parquet, or CSV-with-header.

    3. Read and select the checkbox to agree to the terms. Click Complete. The page automatically redirects to the Backup Download List tab. Wait for the download task to complete.

      Note
      • The backup file download feature requires you to grant Database Backup Service (DBS) the permissions to access your cloud resources. If you have not granted the permissions, follow the prompts on the console to click Go to Authorize > Confirm Authorization. After the authorization is successful, return to the advanced download configuration page and complete the configuration.

      • The conversion process competes for computing resources on the server side. A download may fail because of a temporary resource allocation failure. Downloads can also fail because of unsupported data formats. If a task fails, you can retry the download task or contact the DBS helpdesk.

      • No fees are charged for failed tasks.

    4. View the backup file. If the task status is Successful, the download is complete. You can go to the corresponding OSS bucket to view the file.

    URL

    If you select URL as the download destination, the system temporarily stores the converted data in DBS Storage. No storage fees are charged for this process.

    Note

    Downloading by URL involves data packaging and requires extra waiting time. The time required depends on the logical size of the backup set. If the logical backup size is large, such as more than 1 TB, we recommend that you download the backup to OSS.

    1. Select a download format. You can set the download format to CSV, SQL, Parquet, or CSV-with-header.

    2. Read and select the checkbox to agree to the terms. Click Complete. The page automatically redirects to the Backup Download List tab. Wait for the download task to complete.

      Note
      • The backup file download feature requires you to grant DBS the permissions to access your cloud resources. If you have not granted the permissions, follow the prompts on the console to click Go to Authorize > Confirm Authorization. After the authorization is successful, return to the advanced download configuration page and complete the configuration.

      • The conversion process competes for computing resources on the server side. A download may fail because of a temporary resource allocation failure. Downloads can also fail because of unsupported data formats. If a task fails, you can retry the download task or contact the DBS helpdesk.

      • No fees are charged for failed tasks.

    3. View the backup file. If the task status is Successful, the download is complete. Click Generate Link in the Download Destination column. Set the Validity Period for the link and click Generate Link. You can then download the backup data using the generated internal or public network link.

      Note
      • You can obtain the download link within three days after the task is complete. The link is valid for 5 minutes to 1 day. The default validity period is 2 hours.

      • Completed tasks expire after three days, and the download link also expires. After a task expires, its data is automatically deleted. If you need the data, start a new download task to obtain a new link.

      • Save the download link immediately to prevent it from being leaked.

      • Using third-party software to download backup files may cause extra network traffic and lead to additional charges. Use such software with caution. For more information about specific download methods, see Download commands.

API operations

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

    Note

    If the API response indicates that the feature is not supported, check whether your cluster's edition or region meets the prerequisites.

  2. CreateDownload: Create a backup file download task.

    Note
    • The backup file download feature requires you to grant DBS the permissions to access your cloud resources (the AliyunDBSDefaultRole permission). If you have not granted the permissions, you can first grant them in the console.

    • When TargetType (download destination type) is set to OSS, you must first create the corresponding bucket manually. The storage class of the OSS bucket must be Standard.

    • When TargetType (download destination type) is set to URL, keep the returned TaskId (task ID) parameter to obtain the download link.

    • You cannot cancel a backup download task after it starts.

    • Backup download tasks incur fees. For more information, see Billing.

  3. (Optional) DescribeDownloadTask: View the information about the backup file download tasks of the current cluster, including the task status.

  4. Obtain the backup file:

    • If the download destination type is OSS, the system writes the data directly to your OSS. You can view the data in the corresponding bucket.

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

      Note
      • You can obtain the download link within three days after the task is complete. The link is valid for 5 minutes to 1 day. The default validity period is 2 hours.

      • Completed tasks expire after three days, and the download link also expires. After a task expires, its data is automatically deleted. If you need the data, start a new download task to obtain a new link.

      • Save the download link immediately to prevent it from being leaked.

      • Using third-party software to download backup files may cause extra network traffic and lead to additional charges. Use such software with caution. For more information about specific download methods, see Download commands.

FAQ

Can I cancel a backup download task that is in progress?

You cannot cancel a backup download task once it has started.

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

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

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

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

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

Can I directly restore a downloaded backup file to another PolarDB cluster?

You cannot directly restore the downloaded backup files to another PolarDB cluster. You can first restore the backup file to a self-managed MySQL database, and then use DTS to migrate the data from the self-managed MySQL database to a PolarDB for MySQL cluster.

Appendix

RAM user permissions

The authentication for the backup file download feature depends on permission management in Resource Access Management (RAM). You can configure permissions for your account to obtain download link strings using RAM.

Grant a RAM user the permissions to download backup files

If you cannot use the backup download feature, such as create or query download tasks, check whether your RAM user is granted the permissions to manage Data Disaster Recovery (AliyunDBSFullAccess). For more information about how to grant permissions, see Manage RAM user permissions.

Deny a RAM user the permissions to get backup file download links

If your RAM user needs permissions to use the backup and recovery feature but must be denied the permissions to obtain backup file download links, you can create a custom permission policy to deny the RAM user the permissions to call the API operation that obtains download links. The following sample script provides a reference:

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

After you create the custom policy, grant the policy to your RAM user. Then, the RAM user is denied the permissions to obtain download links.

Allow a read-only RAM user to download backup files

For security reasons, if a RAM user has only read-only permissions on PolarDB resources (AliyunPolardbReadOnlyAccess), the RAM user cannot download backup files.

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

image.png

Download commands

Note
  • If the network download speed is lower than 64 KB/s, the download may be interrupted. Make sure that the network connection is stable during the download.

  • If you download a backup file to a disk mounted using ossfs, you may also need to adjust the multipart_size parameter for ossfs. By default, this parameter supports files up to 100 GB. If the backup file to download is larger than 100 GB, the download fails. For more information about ossfs and its parameter settings, 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 other third-party tools, a file may be downloaded multiple times. This can cause the actual downloaded data volume to be larger than the backup file size. You are charged for the outbound Internet traffic that is generated by the excess data.

wget

nohup wget -c -t 0 "Download URL of the backup file" -O Path and file name of the destination file > Path to which the download log is output &

Metric description

Parameter

Description

nohup

Prevents the download from being interrupted if you accidentally perform a copy operation or the terminal disconnects. After the download is complete, the process automatically exits.

-c

Enables resumable downloads.

-t

The number of retries. If you set this parameter to 0, the number of retries is unlimited.

-O

Specifies the path and file name of the destination file.

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_filename > download_output_log_file &

Metric description

Parameter

Description

nohup

Prevents the download from being interrupted if you accidentally perform a copy operation or the terminal disconnects. After the download is complete, the process automatically exits.

-C -

Enables automatic resumable downloads.

--retry

The number of retries. If you set this parameter to 10, the system retries 10 times.

-o

Specifies the path and file name of the destination file.

Example

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