Database Backup (DBS) allows you to back up binary logs of MySQL databases in addition to full and incremental data. You can use full backups, incremental backups, and log backups to restore a database to a point in time and achieve a recovery point objective (RPO) in seconds.

Billing

The log backup feature can be enabled free of charge. After the feature is enabled, you are charged for the backup and storage of binary logs. For more information, see Billing overview.

Preparations

  1. A self-managed MySQL database is physically backed up. For more information, see Back up MySQL databases.
  2. The binary logging feature is enabled for the database. To enable the binary logging feature, perform the following steps:
    1. Run the following command to check whether the binary logging feature is enabled for the MySQL database:
      show variables like '%log_bin%';
    2. Optional:If the binary logging feature is disabled, enable the feature.
      1. Add the following content to the /etc/my.cnf file:
        log_bin = mysql-bin
        binlog_format = ROW
      2. Run the service mysql start command to restart the MySQL service.

Enable incremental log backup

  1. Log on to the Database Backup (DBS) console.
  2. In the left-side navigation pane, click Backup Schedules. Then, in the top navigation bar, select a region.
  3. Find the backup schedule for which you want to enable incremental log backup and click Manage in the Actions column. The Configure Task page appears.
  4. In the Task Running Information section, click Enable Incremental Log Backup. In the message that appears, click OK.
  5. The Precheck message appears. After the precheck succeeds, click Start Task or click the close icon in the upper-right corner of the message.
    Note
    • If you click Start Task, DBS starts a full backup task and an incremental backup task.

      After the full backup task is complete, you can restore the data to a point in time from the completion of the first full backup.

    • If you click the close icon, DBS does not start a full backup task or an incremental backup task.

      The next time a full backup task starts, DBS starts an incremental backup task based on the original scheduling policy of the full backup set. After the full backup task is complete, you can restore the data to a point in time from the completion of the first full backup.

    • If the precheck fails, try again as prompted. For more information, see Common Errors and Troubleshooting.

Restore a database

Method 1: Regular restoration

  1. Select a point in time in the DBS console to restore a database. DBS restores the data at the specified point in time to the offline directory that you specify. For more information, see Restore a database.
  2. Enable the MySQL service.
  3. Optional:If a time difference exists between MySQL and the selected time point, the system generates a file named binlog in the ./_restoration directory_/dbsbinlog directory. Information about the time difference is included in the binlog file. You can manually replay the binlog file by using the Binlog tool provided by MySQL to restore the database to the specified point in time.
    Note The directory also contains the help file named ReadMe.txt and the statement for binary log replay.

Method 2: Restoration from a CMD-based sandbox

Select a point in time in the DBS console to restore a database. DBS generates a sandbox instance based on the data at the specified point of time. For more information, see Create a sandbox instance for the emergency disaster recovery of a self-managed database.