Enable automatic backup for an ApsaraDB MyBase for MySQL instance

更新时间:
复制 MD 格式

ApsaraDB MyBase for MySQL automatically backs up your instance data and binary logs on a schedule you define. If data is lost or corrupted, restore it from these backups. ApsaraDB MyBase for MySQL supports both automatic backup and manual backup. This topic describes the automatic backup feature.

How automatic backup works

ApsaraDB MyBase for MySQL performs two types of automatic backup:

  • Data backup: A full backup of your instance data. The backup type depends on the storage type — Enhanced SSD (ESSD) instances use Snapshot Backup by default, and local SSD instances use Physical Backup by default.

  • Log backup: Binary logs captured continuously to support point-in-time recovery (PITR). Log backup is enabled by default.

The retention period you set determines your recovery window. A 7-day retention period means you can restore data to any point within the last 7 days.

Schedule backups during off-peak hours to minimize impact on your workload.

Limitations

LimitationDetails
Read-only instancesBackup policies cannot be configured for read-only instances.
DDL statementsDo not run DDL statements during a backup. DDL statements lock the affected tables, which causes the backup to fail.
Table countIf a database contains more than 600,000 tables, backup cannot run. Split large table sets across multiple databases to stay within this limit.
Backup file downloadDownload backup files before the retention period ends. Files are deleted automatically when the retention period elapses.

Prerequisites

Before you begin, ensure that you have:

Configure automatic backup

  1. Log on to the ApsaraDB for MyBase console.

  2. In the upper-left corner, select a region.

  3. In the left-side navigation pane, choose Instances > MySQL.

  4. Find the instance you want to configure, and click Details in the Actions column.

  5. In the left-side navigation pane, click Backup and Restoration.

  6. On the Backup and Restoration page, click the Backup Settings tab, then click Edit.

  7. Configure the data backup and log backup settings described in the following sections, then click Save.

Data backup settings

The following parameters apply to all instances (ESSD and local SSD):

ParameterDescription
Data Backup Retention (Days) / Retention PeriodThe number of days to retain data backups, which equals your maximum recovery window. Default: 7 days. For ESSD instances, valid range is 7–730 days. For local SSD instances, valid values are any integer ≥ 7 and < 2³¹. Backups retained for 730 days or fewer are regular backups. Backups retained for more than 730 days are archived backups. If you set a value greater than 730 or enable Long-term Retention, specify how many archived backups to keep — for example, selecting Monthly and entering 2 retains the first two archived backups generated each month.
Backup CycleThe days of the week on which data backups run. Select at least two days per week.
Backup TimeThe one-hour time window during which the backup runs (for example, 05:00–06:00). Schedule this window during off-peak hours to minimize the impact on your workload.

The following parameters apply to local SSD instances only:

ParameterDescription
Data Backup Retention Policy After ReleaseWhat happens to backups when the instance is released. Options: None, Latest, or All.
Restore Individual Database/TableEnables granular restore at the database or table level. Enabled by default and cannot be disabled.
Restore SpeedThe speed at which individual databases and tables are restored. For details, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.

The following parameters apply to ESSD instances only:

ParameterDescription
Single-digit Second BackupEnables snapshot backups that complete in seconds. Enabling this feature sets the data backup retention period to 7 days.
Increase Snapshot FrequencyIncreases snapshot frequency to as often as once every 15 minutes. Requires Single-digit Second Backup to be enabled — if that feature is disabled, enabling this parameter enables it automatically. When enabled, the snapshot retention policy depends on the granularity you set: Minute granularity — all snapshots within the last hour are kept; snapshots older than 1 hour are pruned to one per hour; snapshots older than 24 hours are pruned to one per day (retained after 00:00). Hour granularity — all snapshots within the last 24 hours are kept; snapshots older than 24 hours are pruned to one per day (retained after 00:00).

Log backup settings

ParameterDescription
Log BackupEnables binary log backup for point-in-time recovery. Enabled by default.
Log Retention Period (Days)The number of days to retain log backups. Valid range: 7–730 days. Default: 7 days. Must be less than or equal to the Data Backup Retention (Days) value.