All Products
Search
Document Center

PolarDB:Configure backup settings

Last Updated:Oct 19, 2023

PolarDB for MySQL supports data backup and redo log backup. Backing up data is a process of creating a backup set (snapshot) of all data on a cluster at a certain point in time. Backing up redo logs is a process of recording the new data after a backup set is created. You can configure policies for data backup and redo log backup. For example, you can specify the backup method, the retention periods of data backup files and log backup files, and the storage location.

Procedure

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the left-side navigation pane, choose Settings and Management > Restoration.
  5. On the Backup Policy Settings tab, click Modify.
  6. In the Backup Policy Settings dialog box, configure the parameters in the Data Backup, Log Backup, and General sections.
    Configure a backup policy
  7. Click OK.

Parameters in the Data Backup section

A data backup policy consists of a level-1 backup policy and a level-2 backup policy.

Backup methodParameterDescription
Level-1 backupBackup methodThe backup method that determines the frequency of automatic data backups. You can select Standard Backup or High-frequency Backup.
  • Standard Backup (at specified intervals): performs automatic backup once on each of the specified days of the week. You can set the backup cycle and start time for automatic data backup.
    Note
    • To prevent data loss, automatic backup must be performed at least twice a week.
    • Automatic backup files cannot be deleted.
  • High-frequency Backup: performs multiple automatic backups within 24 hours. This backup method increases backup frequency to speed up data restoration in PolarDB for MySQL.

    You can configure the system to perform a backup once every two, three, or four hours. The first backup is created two hours after you configure the backup policy regardless of the backup frequency you specify.

    The system retains all backups files that are created by this backup method within the last 24 hours. For backup files created earlier than the last 24 hours, the system permanently retains only the first backup that is created after 00:00 every day and deletes the rest.

    For example, if you select Last 24 Hours, Every 4 Hours at 08:00 on March 1, the system automatically creates the first backup within two hours (from 08:00 to 12:00) on March 1. Then, the system continues to create backups at an interval of four hours.

    If the current time is 16:00 on March 4, the following backups are retained:
    • The backups created within the last 24 hours (from 16:00 on March 3 to 16:00 on March 4).
    • The backup created between 00:00 and 4:00 on March 3.
    • The backup created between 00:00 and 4:00 on March 2.
    • The backup created between 08:00 and 12:00 on March 1.
    1
    Then, 4 hours later (at 20:00) on March 4, the following backups are retained:
    • The backups created within the last 24 hours (from 20:00 on March 3 to 20:00 on March 4).
    • The backup created between 00:00 and 4:00 on March 3.
    • The backup created between 00:00 and 4:00 on March 2.
    • The backup created between 08:00 and 12:00 on March 1.
    2
Backup CycleThe days of the week on which automatic data backups are performed.
Note This parameter is required only when Standard Backup is selected.
Start TimeThe time range within which automatic data backups are performed.
Note This parameter is required only when Standard Backup is selected.
Backup FrequencyThe interval at which automatic backups are performed. Valid values: Last 24 Hours, Every 4 Hours, Last 24 Hours, Every 2 Hours, and Last 24 Hours, Every 3 Hours.
Note This parameter is required only when High-frequency Backup is selected.
Data Backup Retention PeriodThe retention period of level-1 backups.
Note
  • By default, level-1 backup is enabled. The default retention period of level-1 backups is 7 days.
  • The valid values of the retention period are 3 to 14 days.
Level-2 backupSwitch for Level-2 BackupSpecifies whether to enable the level-2 backup feature.
Note
  • By default, the level-2 backup feature is disabled. If you enable the feature, storage fees are incurred. You can delete backup files to reduce costs. For more information about the pricing of level-2 backup, see Billing rules of backup storage that exceeds the free quota.
  • Backup dumping rule: When level-2 backup is enabled, the system dumps the first backup created on the days selected for the Backup Cycle parameter.
  • When level-2 backup is enabled, backups are dumped only when the conditions in the backup dumping rule are met.
Backup methodValid values: Same-region Backup and Cross-region Backup.
Note
  • By default, Same-region Backup is selected.
  • If you select both Same-region Backup and Cross-region Backup, two copies of the backup data are dumped.
Backup CycleThe days on which level-2 backups are performed.
Note You can only select the days specified in the Backup Cycle parameter for level-1 backups.
Same-region Backup and RetentionThe retention period of same-region backups.
Note
  • Level-2 backups can be retained for 30 to 7,300 days.
  • If you want to permanently retain level-2 backups, select Permanently Retain Backups before Cluster Deletion. After you select this option, you cannot specify the retention period of level-2 backups.
Destination Backup RegionThe region in which the backup data is to be stored.
Cross-region Backup and RetentionThe retention period of cross-region backups.
Note
  • Level-2 backups can be retained for 30 to 7,300 days.
  • If you want to permanently retain level-2 backups, select Permanently Retain Backups before Cluster Deletion. After you select this option, you cannot specify the retention period of level-2 backups.

Parameters in the Log Backup section

When you configure a redo log backup policy, you must specify the retention period of redo logs.

ParameterDescription
Backup methodValid values: Same-region Backup and Cross-region Backup.
Note
  • By default, log backup is enabled and cannot be disabled.
  • Cross-region log backup can be enabled only when cross-region level-2 backup is enabled.
Same-region Backup and RetentionThe retention period of same-region log backups.
Note
  • Log backup files can be retained for 3 to 7,300 days.
  • To retain log backups permanently, select Permanently Retain Backups before Cluster Deletion. The retention period parameter becomes unavailable after you select this option.
Destination Backup RegionThe value of the parameter is the same as the value of the Destination Backup Region parameter for level-2 backup. You do need to specify this parameter.
Cross-region Backup and RetentionThe retention period of cross-region backups.
Note
  • Log backup files can be retained for 3 to 7,300 days.
  • To retain log backups permanently, select Permanently Retain Backups before Cluster Deletion. The retention period parameter becomes unavailable after you select this option.

Parameters in the General section

You can configure a backup retention policy that applies when you delete a cluster.

ParameterDescription
When Cluster Is DeletedThe backup retention policy that applies when you delete a cluster.
  • Permanently Retain Last Automatic Backup: retains all backups when you delete a cluster.
  • Permanently Retain Last Automatic Backup: retains the most recent backup when you delete a cluster.
  • Immediately Delete All Backups: does not retain backups when you delete a cluster.
Note
  • If you select the Permanently Retain Last Automatic Backup or Permanently Retain Last Automatic Backup policy, the system runs an automatic backup task to retain all data when you delete the PolarDB for MySQL cluster.
  • After you delete a cluster, level-1 backups automatically become level-2 backups. You can go to the Cluster Recycle Bin page to view all backups. For more information, see Restore a released cluster.
  • The policies also apply to cross-region backups. If cross-region backup is enabled and Immediately Delete All Backups is selected, the backup sets that reside in other regions are also deleted when you delete the cluster.

Related API operations

APIDescription
DescribeBackupPolicyQueries the backup policy of a specified PolarDB for MySQL cluster.
ModifyBackupPolicyModifies the backup policy of a specified PolarDB for MySQL cluster.