All Products
Search
Document Center

PolarDB:Configure a backup policy

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 frequency of automatic data backups, the retention period of data backup files, the storage location, and the retention period of log backup files.

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.
    • Parameters in the Data Backup section
      To configure a data backup policy, specify the frequency of automatic backups and the storage location and retention period of the backup files generated by automatic backups and manual backups.
      ParameterDescription
      Backup FrequencyThe frequency of automatic backups. You can select Standard Backup (at specified intervals) or High-frequency Backup.
      • Standard Backup (at specified intervals): By default, automatic backup is performed once a day. You can set the 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:PolarDB for MySQL supports enhanced protection in last 24 hours. This feature increases backup frequency to speed up data restoration. You can specify the backup frequency which can be Last 24 Hours, Every 2 Hours, Last 24 Hours, Every 3 Hours, or Last 24 Hours, Every 4 Hours.

        After you enable enhanced backup, all backups are retained for 24 hours. Backups are automatically deleted when the retention period expires. However, the system permanently retains the first backup that is created after 00:00 every day.

        For example, if you specify a backup frequency of every 4 hours at 08:00 on March 1, the system automatically creates the first backup within four hours from 08:00 to 12:00 on March 1. Then, the system continues to create a backup at an interval of four hours.

        If the current time is 16:00 on March 4, the system retains the following backups:
        • The backups created within the last 24 hours (from 16:00 on March 3 to 16:00 on March 4).
        • The backups created between 00:00 and 4:00 on March 3.
        • The backups created between 00:00 and 4:00 on March 2.
        • The backups created between 08:00 and 12:00 on March 1.
        1
        Then, after four hours or at 20:00 on March 4, the system retains the following backups:
        • The backups created within the last 24 hours from 20:00 on March 3 to 20:00 on March 4.
        • The backups created between 00:00 and 4:00 on March 3.
        • The backups created between 00:00 and 4:00 on March 2.
        • The backups created between 08:00 and 12:00 on March 1.
        2
      Data Backup Retention PeriodThe storage location and retention period of the data backup files generated by automatic backups and manual backups.

      You can specify Level-1 Backup or Level-2 Backup as the storage location. For more information, see Data backup.

      • Level-1 Backup: Set the retention period for level-1 backups.
        Note
        • By default, level-1 backup is enabled. The default retention period of level-1 backups is 7 days.
        • A backup can be retained for 3 to 14 days.
      • Level-2 Backup: enable or disable 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.
        • 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
      Log Retention Period (Days)Specifies the retention period for log backup.
      Note
      • By default, log backup is enabled, and backup files are retained for seven days. You cannot disable log backup.
      • 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 after you delete a cluster.
      • Permanently Retain Last Automatic Backup: retains the most recent backup after you delete a cluster.
      • Immediately Delete All Backups: does not retain backups after 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 are automatically transferred to level-2 backups. You can go to the Cluster Recycle Bin page to view all backups. For more information, see Restore a released cluster.

Related API operations

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