PolarDB lets you download backup files from a cluster backup set to your local machine for long-term storage, querying historical data, transferring backups (for example, to OSS), and auditing.
You cannot directly restore downloaded backup data to a PolarDB for MySQL cluster. You can restore downloaded backup files to a self-managed MySQL database.
Release date
November 24, 2023
The backup file download feature is in canary release and will be rolled out gradually.
Billing
You can download backup files via URL (temporarily stored in DBS) or transfer them to your OSS. Charges vary by download destination:
-
If a download task fails, no fees are charged.
-
In the PolarDB console, go to for your cluster to view the monthly backup conversion volume and monthly outbound internet traffic.
Storage fees
-
URL: Files are temporarily stored in DBS's built-in storage. No storage fees are charged.
-
OSS: Files are transferred to your OSS bucket. For more information about OSS storage fees, see OSS storage fees.
Backup set conversion fees
Converting a backup set to SQL, CSV, Parquet, or CSV-with-header format incurs conversion fees, regardless of whether the destination is a URL or OSS. No free quota is available for this conversion. The price is USD 0.03125 per GB.
Traffic fees
-
URL:
-
Download over an internal network: Free of charge.
-
Download over the internet: A free quota of 500 GB per cluster per month is provided. Data transfer 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 information about pricing, see Network fees.
NoteWe recommend that you purchase a subscription data transfer plan to cover the network traffic fees for downloading backups over the internet. The larger the capacity of the data transfer plan, the higher the discount.
-
-
OSS: Files are transferred to your OSS bucket. For information about traffic fees, see OSS traffic fees.
Prerequisites
-
Cluster: This feature is available only for the Cluster Edition of Enterprise Edition clusters.
-
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).
NoteThis feature will be available in other regions soon.
-
Other:
-
The RAM user must have the permissions to download backup files. To grant permissions to a RAM user, see RAM user permissions.
-
Backup data is not encrypted. You cannot download backup files from encrypted PolarDB clusters.
-
Only one download task (running or failed) is allowed per cluster or instance at a time.
-
Limitations
-
The download process exports most, but not all, table structures:
-
Supported for export: column information, primary key indexes, non-primary key indexes, unique indexes, partitioned table information, table engines, and character sets and collations at the table or database level.
-
Not supported for export: expression indexes, foreign keys, generated columns, hidden columns, views, functions, stored procedures, system variables, and triggers.
-
-
Conversion tasks will fail if your data includes fields with the following spatial data types:
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 storage class of the OSS bucket must be Standard. To change the storage class, see Convert storage classes.
NoteYou must manually create an OSS bucket. You can skip this step if you have already created a bucket for storing backup files.
-
You can download data only from a level-1 backup. Data from a level-2 backup cannot be downloaded.
-
If cold data archiving is enabled for the cluster, you cannot download a backup set.
-
If the names of the databases or tables to be downloaded contain forward slashes (/), the download task fails.
Procedure
(Recommended) Use the console
-
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where the cluster is located, and then click the cluster ID to go to the cluster details page.
-
In the left-side navigation pane, click .
-
On the Data Backups tab, find the target backup set and click Download Cluster Backup in the Actions column.
Note-
By default, the console displays backups from the last eight days. To view older backups, you must change the time range.
-
If the Download Cluster Backup button is not displayed, verify that your cluster's product version or region meets the prerequisites.
-
-
In the Point in Time and Backup Set step, select Download by Point in Time or Download by Backup Set, and then click Next.
If you select By Backup Set, select a target backup set from the Backup Set drop-down list.
-
In the Instance, Database, and Table step, click Next. The Instance Download option is pre-selected and cannot be changed.
-
In the 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 to save time.
-
A backup download task cannot be canceled after it starts.
-
Backup download tasks incur charges. For more information, see Billing.
(Recommended) OSS
If you select OSS as the download destination, data is written directly to your OSS bucket. You can delete the data as needed after the download is complete.
-
Enter your OSS Bucket Name and a directory prefix, such as
xx/xx.Note-
You must manually create an OSS bucket. 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. To change the storage class, see Convert storage classes.
-
-
Select a download format. You can set the download format to CSV, SQL, Parquet, or CSV-with-header. Select a format based on your business requirements.
-
Read and agree to the terms, and then click Complete. You are redirected to the Backup Download List tab. Wait for the download task to complete.
Note-
The backup download feature requires DBS to be authorized to access your cloud resources. If you have not granted access permissions, follow the prompts in the console to click . After the authorization is successful, you can return to the advanced download configuration page and enter the required information as described in the preceding steps.
-
Format conversion is resource-intensive. A download may fail if server resources are temporarily unavailable. Unsupported special data formats can also cause download failures. If a task fails, we recommend that you retry the download task or contact DBS technical support.
-
No fees are charged for failed tasks.
-
-
After the task status changes to Successful, you can view the backup file in the corresponding OSS bucket.
URL
If you select URL as the download destination, the system temporarily stores the converted data in the built-in storage of DBS. No storage fees are charged for this process.
NoteDownloading from a URL involves data packaging, which requires additional time. The time required is related to the logical size of the backup set. If the backup set is large (for example, larger than 1 TB), we recommend that you download to OSS.
-
Select a download format. You can set the download format to CSV, SQL, Parquet, or CSV-with-header. Select a format based on your business requirements.
-
Read and agree to the terms, and then click Complete. You are redirected to the Backup Download List tab. Wait for the download task to complete.
Note-
The backup download feature requires DBS to be authorized to access your cloud resources. If you have not granted access permissions, follow the prompts in the console to click . After the authorization is successful, you can return to the advanced download configuration page and enter the required information as described in the preceding steps.
-
Format conversion is resource-intensive. A download may fail if server resources are temporarily unavailable. Unsupported special data formats can also cause download failures. If a task fails, we recommend that you retry the download task or contact DBS technical support.
-
No fees are charged for failed tasks.
-
-
View the backup file: If the download task status is Successful, the download is complete. In the Download Destination column, click Generate URL, set the Validity Period, and then click Generate URL. You can then use the generated internal or public URL to download the backup data.
Note-
You can obtain the download link within three days of the task's completion. The link validity period can be set from 5 minutes to 1 day. The default validity period is 2 hours.
-
Completed tasks expire after three days, at which point the download link also expires. The data from an expired task is automatically deleted after expiration. If you still need the data, you must start a new download task to get a new download link.
-
Save the download link and keep it confidential to prevent data leaks.
-
Using third-party download tools might incur extra download traffic and lead to additional charges. Use these tools with caution. For information about recommended download methods, see Download commands.
-
-
Use an API
-
DescribeDownloadSupport: queries whether your cluster supports the backup file download feature.
NoteIf the API response indicates that the feature is not supported, verify that your cluster's product version and region meet the prerequisites.
-
CreateDownload: creates a backup file download task.
Note-
The backup download feature requires you to grant the
AliyunDBSDefaultRolepermissions to DBS to access your cloud resources. If you have not granted these permissions, you can first grant them by using the console. -
When TargetType (download destination type) is OSS, you must first manually create the destination bucket and ensure its storage class is Standard.
-
When TargetType (download destination type) is URL, you must save the returned
TaskId(task ID) to retrieve the download link. -
A backup download task cannot be canceled after it starts.
-
Backup download tasks incur charges. For more information, see Billing.
-
-
(Optional) DescribeDownloadTask: View the status and other details of your cluster's backup download tasks.
-
Obtain the backup file:
-
If the download destination is OSS, the system writes the data directly to your OSS bucket, where you can view it.
-
If the download destination is a URL, you can call the DescribeDownloadBackupSetStorageInfo operation to obtain the download link.
Note-
You can obtain the download link within three days of the task's completion. The link validity period can be set from 5 minutes to 1 day. The default validity period is 2 hours.
-
Completed tasks expire after three days, at which point the download link also expires. The data from an expired task is automatically deleted after expiration. If you still need the data, you must start a new download task to get a new download link.
-
Save the download link and keep it confidential to prevent data leaks.
-
Using third-party download tools might incur extra download traffic and lead to additional charges. Use these tools with caution. For information about recommended download methods, see Download commands.
-
-