All Products
Search
Document Center

PolarDB:Download backup files

Last Updated:Mar 28, 2026

PolarDB lets you download backup files from cluster backup sets to your local machine. Use downloaded files for long-term storage, historical data queries, transferring backups to Object Storage Service (OSS), or auditing.

Warning

Downloaded backup data cannot be restored directly to a PolarDB for MySQL cluster. To use the data in PolarDB, first restore the backup files to a self-managed MySQL database, then use DTS to migrate the data back.

The backup file download feature was released on November 24, 2023 and is being rolled out gradually.

How it works

Downloading a backup file involves these steps:

  1. Verify that your cluster meets the prerequisites.

  2. In the PolarDB console or via API, create a download task and choose a download destination (OSS or URL).

  3. Wait for the conversion task to complete.

  4. Retrieve the backup file from your OSS bucket or generate a download link.

Prerequisites

Before you begin, make sure that:

  • Cluster edition: Your cluster is an Enterprise Edition cluster of the Cluster series.

  • Region: Your cluster is deployed in one of the supported regions: 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), or Germany (Frankfurt).

    The feature will be available in other regions soon.
  • RAM permissions: Your RAM user has permissions to download backup files. See RAM user permissions.

  • Encryption: The cluster's backup data is not encrypted. Encrypted clusters do not support backup file download.

  • Concurrent tasks: No download task is currently running or has failed for this cluster. Only one download task per cluster is allowed at a time.

Billing

The feature supports two download destinations: URL and OSS. Fees vary by destination.

Failed download tasks are not charged. To monitor your usage, go to the PolarDB console and navigate to Settings and Management > Backup and Restoration > Backup Download List. There you can view the Monthly Backup Compute Data Volume and Monthly Outbound Internet Traffic for your cluster.

Backup set conversion fees

Converting backup sets to SQL, CSV, Parquet, or CSV-with-header format is charged at USD 0.03125 per GB, regardless of download destination. No free quota applies.

Storage fees

  • URL: Files are temporarily stored in Database Backup Service (DBS) Storage. No storage fees apply.

  • OSSThe pricing rate is USD 0.03125 per GB.: Standard OSS storage fees apply. See Object Storage Service storage fees.

Traffic fees

  • URL — internal network: Free.

  • URL — Internet: 500 GB free per cluster per month. Traffic beyond the free quota is billed daily on a pay-as-you-go basis. See Network fees. To offset Internet traffic costs, purchase a network plan—larger plans offer higher discounts.

  • OSS: Standard OSS traffic fees apply. See Object Storage Service traffic fees.

Limitations

  • Expression indexes, foreign keys, and other structural elements are not exported: Items not supported for export include expression indexes, foreign keys, generated columns, hidden columns, views, functions, stored procedures, system variables, and triggers.

  • Spatial data type fields cause task failure: If the data contains fields of these types, the conversion task fails: GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION.

  • System databases are excluded: The following system databases are not included in the export: information_schema, mysql, performance_schema, sys, __recycle_bin__.

  • OSS bucket must use Standard storage class: If the bucket uses a different storage class, convert it to Standard before starting a download task.

    Create the OSS bucket manually before starting the task. If you already have a bucket, skip this step.
  • Level-2 backup data cannot be downloaded: Only level-1 backup data is supported. Level-2 backup data is not.

  • Cold data archiving blocks download: If cold data archiving is enabled for the cluster, backup sets cannot be downloaded.

  • Forward slashes in names cause task failure: If any database or table name contains a forward slash (/), the task fails.

Supported table structure elements (for reference): 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.

Download backup files using the console

Step 1: Locate the backup set

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

  2. In the left navigation pane, 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.

    - By default, the console shows backup data from the last 8 days. To view older backups, change the time range. - If Download Cluster Backup is not displayed, check whether your cluster's edition and region meet the prerequisites.

    image

Step 2: Select download scope

  1. In the Download Point-in-time and Backup Set step, select Download by Point-in-time or Download by Backup Set, then click Next.

    image.png

  2. In the Download Instance and Database/Table step, click Next. Instance Download is selected by default.

Step 3: Configure the download destination

  1. In the Download Destination and Format step, select a download destination and format.

    Important

    - OSS is faster and recommended for large backup sets. - A download task cannot be cancelled after it starts. - Download tasks incur fees. See Billing.

Option 1 (recommended): Download to OSS

Data is written directly to your OSS bucket. Delete it after use if no longer needed.

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

    - The bucket must already exist. Create one if needed. - The bucket's storage class must be Standard. To convert it, see Convert storage classes.
  2. Select a download format: CSV, SQL, Parquet, or CSV-with-header.

  3. Agree to the terms and click Complete. The page redirects to the Backup Download List tab.

  4. Wait for the task to complete. When the task status changes to Successful, go to the OSS bucket to retrieve the file.

    - If you haven't granted DBS permission to access your cloud resources, follow the console prompts to click Go to Authorize > Confirm Authorization, then return to complete the configuration. - If a task fails due to temporary resource allocation issues or unsupported data formats, retry the task or contact the DBS helpdesk. Failed tasks are not charged.

Option 2: Download via URL

Data is temporarily stored in DBS Storage. No storage fees apply for this option.

URL downloads require packaging the data, which takes extra time proportional to the logical backup size. For backup sets larger than 1 TB, OSS is the better choice.
  1. Select a download format: CSV, SQL, Parquet, or CSV-with-header.

  2. Agree to the terms and click Complete. The page redirects to the Backup Download List tab.

  3. Wait for the task to complete. When the task status changes to Successful, click Generate Link in the Download Destination column.

  4. Set the Validity Period and click Generate Link. Use the generated internal or public network link to download the backup data.

    - If you haven't granted DBS permission to access your cloud resources, follow the console prompts to click Go to Authorize > Confirm Authorization, then return to complete the configuration. - If a task fails, retry or contact the DBS helpdesk. Failed tasks are not charged. - The download link is available for three days after the task completes. The link's validity period ranges from 5 minutes to 1 day, with a default of 2 hours. - Tasks expire after three days and their data is automatically deleted. If you need the data after expiration, create a new download task. - Save the download link immediately to prevent leakage. - Third-party download tools may download the file multiple times, generating extra Internet traffic and charges. Use wget or curl instead. See Download commands.

Download backup files using the API

Use the following DBS API operations in sequence:

  1. [DescribeDownloadSupport](https://www.alibabacloud.com/help/en/dms/developer-reference/api-dbs-2021-01-01-describedownloadsupport) — Check whether your cluster supports backup file download.

    If the response indicates the feature is not supported, verify that your cluster's edition and region meet the prerequisites.
  2. [CreateDownload](https://www.alibabacloud.com/help/en/dms/developer-reference/api-dbs-2021-01-01-createdownload) — Create a backup file download task.

    - Grant DBS the AliyunDBSDefaultRole permission before calling this API. If not yet granted, do so via the console first. - If TargetType is OSS, create the bucket manually beforehand. The bucket must use the Standard storage class. - If TargetType is URL, save the returned TaskId to retrieve the download link later. - A task cannot be cancelled after it starts. - Download tasks incur fees. See Billing.
  3. (Optional) [DescribeDownloadTask](https://www.alibabacloud.com/help/en/dms/developer-reference/api-dbs-2021-01-01-describedownloadtask) — View download task information, including task status.

  4. Retrieve the backup file:

    • OSS: Data is written directly to your OSS bucket. View it in the corresponding bucket.

    • URL: Call [DescribeDownloadBackupSetStorageInfo](https://www.alibabacloud.com/help/en/dms/developer-reference/api-dbs-2021-01-01-describedownloadbackupsetstorageinfo) to get the download link.

    - The download link is available for three days after the task completes. The link's validity period ranges from 5 minutes to 1 day, with a default of 2 hours. - Tasks expire after three days and their data is automatically deleted. Create a new task if you need the data after expiration. - Save the download link immediately to prevent leakage. - Third-party download tools may generate extra Internet traffic charges. Use wget or curl instead. See Download commands.

FAQ

Can I cancel a download task that is in progress?

No. Once started, a download task cannot be cancelled.

How do I use the downloaded backup files?

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

Run show variables like 'local_infile'; on MySQL. If the result is OFF, enable file import by running set global local_infile = 1;, then run the import script again.

Why is the downloaded file smaller than the backup size shown in the console?

Downloaded backup files are compressed, so they are generally smaller than the size displayed in the console. Restore the files to verify that the data is complete.

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

No. Restore the backup file to a self-managed MySQL database first, then use DTS to migrate the data to another PolarDB for MySQL cluster.

Appendix

RAM user permissions

Backup file download permissions are managed through Resource Access Management (RAM). Configure them based on your access requirements.

Grant a RAM user permission to download backup files

If a RAM user cannot create or query download tasks, grant them the AliyunDBSFullAccess policy (full access to Data Disaster Recovery). See Manage RAM user permissions.

Deny a RAM user permission to get download links

To allow a RAM user to use backup and recovery features but block access to download links, create a custom permission policy that denies the dbs:DescribeDownloadBackupSetStorageInfo action:

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

After creating the policy, grant it to the RAM user.

Allow a read-only RAM user to download backup files

RAM users with only AliyunPolardbReadOnlyAccess cannot download backup files. To grant download access, add the AliyunDBSReadOnlyAccess policy. This allows the user to view download links for created backup download tasks.

image.png

See Manage RAM user permissions for instructions.

Download commands

Use wget or curl to download backup files. Third-party tools may download files multiple times, generating extra Internet traffic charges.

If the network speed drops below 64 KB/s, the download may be interrupted. Make sure your network connection is stable.
For disks mounted with ossfs, you may need to adjust the multipart_size parameter. The default value supports files up to 100 GB. For files larger than 100 GB, increase the parameter value. See ossfs and Mount options.

wget

nohup wget -c -t 0 "<backup-file-download-url>" -O <destination-path/filename> > <log-output-path> &
ParameterDescription
nohupKeeps the download running if the terminal disconnects or a copy operation interrupts it. The process exits automatically when the download completes.
-cEnables resumable downloads.
-t 0Sets unlimited retries.
-OSpecifies the destination path and filename.

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 <destination-filename> > <log-output-path> &
ParameterDescription
nohupKeeps the download running if the terminal disconnects or a copy operation interrupts it. The process exits automatically when the download completes.
-C -Enables automatic resumable downloads.
--retry 10Retries up to 10 times on failure.
-oSpecifies the destination path and filename.

Example:

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