Database Backup (DBS) allows you to physically back up MySQL databases in full backup, incremental backup, and binary log backup modes. This topic describes how to physically back up a MySQL database.

Prerequisites

  • The database to be backed up is a self-managed Linux-based MySQL database, and the database uses one of the following versions of MySQL engines: 8.0, 5.7, 5.6, and 5.5.
    Note
    • A self-managed MySQL database that uses MySQL 5.7, 5.6, or 5.5 supports the following Linux operating systems: Red Hat Enterprise Linux, CentOS, and Oracle Linux 6, 7, and 8.
    • A self-managed MySQL database that uses MySQL 8.0 supports the following Linux operating systems: Red Hat Enterprise Linux, CentOS, and Oracle Linux 7.
  • A backup gateway is installed on the server on which the database to be backed up is deployed. For more information, see Add a backup gateway.

Create a backup schedule

For more information, see Purchase a backup schedule.

Note When you purchase a backup schedule, set the Data Source Type parameter to MySQL and set the Backup Method parameter to Physical Backup.

Configure the backup schedule

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page, select a region in the upper-left corner.
  3. On the Backup Schedules page, find the ID of the backup schedule that you want to configure and click Configure Backup Schedule in the Actions column.
  4. In the Configure Backup Source and Destination step of the Configure Backup Schedule wizard, configure the backup source and destination, and click Next in the lower-right corner of the page.
    Configure physical backup for a MySQL database
    Section Parameter Description
    N/A Schedule Name

    The name of the backup schedule. DBS automatically generates a backup schedule name. We recommend that you set a descriptive name that is easy to identify. Backup schedule names do not need to be unique.

    Backup Source Information Backup Mode

    The method used to back up data. By default, the backup method that you selected when you purchased the backup schedule is used.

    Backup Type
    The type of the backup. Select Native physical backup to physically back up a MySQL database.
    Note Do not select Physical backup dump because this type of backup is not supported.
    Instance Region

    The region in which the database that you want to back up resides. The backup gateway must reside in the same region.

    Backup Gateway

    The backup gateway that is installed to back up data. For more information about how to install a backup gateway, see Add a backup gateway.

    Database Type

    The type of the source database. Default value: MySQL.

    Address The IP address of the server on which the source database is deployed. Default value: 127.0.0.1.
    Port Number The number of the port used to connect to the database that you want to back up. Default value: 3306.
    Database Account

    The username of the account that is used to connect to the database that you want to back up. The account must have specific permissions to back up the database. For more information, see Account permissions.

    Password

    The password of the account that is used to connect to the database that you want to back up.

    Backup Destination Information Backup Storage Type The type of storage that is used to store the backup data. Valid values:
    • DBS Storage (recommended): Backup data is stored in DBS without requiring you to create storage space. You are charged based on the volume of your data that is stored in DBS. For more information about the billing method, see Storage fees.

      To reduce storage costs, we recommend that you use subscription storage plans. For more information, see Use storage plans.

    • OSS For User: You must create a bucket in the Object Storage Service (OSS) console in advance. For more information, see Create buckets.
    Note In this example, DBS Storage (recommended) is selected. If you select OSS For User, you must set the OSS Bucket Name parameter, and only the Standard storage class is supported.
    OSS Bucket Name

    The name of the OSS bucket that you want to use to store data.

    This parameter is displayed only if you set the Backup Storage Type parameter to OSS For User.

    Storage Encryption Specifies whether to encrypt data and the method that you want to use to encrypt data. Valid values:
    • Encrypted: recommended. DBS uses AES-256, which is one of the advanced encryption standard ciphers, to encrypt the stored data.

      The server-side encryption feature is used in OSS. When you upload an object to OSS, OSS encrypts and stores the object. When you download the encrypted object from OSS, OSS decrypts the object and returns the decrypted object to you. For more information, see Server-side encryption.

    • Non-encrypted: The backup data is not encrypted.
  5. In the Edit Backup Objects step, Back Up Entire Instance is selected by default. Then, click Next.
    Note To perform a physical backup, you must back up the entire instance. If you back up an entire instance, the permissions and stored procedures are also backed up.
  6. In the Configure Backup Time step, set the parameters that are described in the following table and click Next in the lower-right corner of the page.
    Parameter Description
    Full-scale Backup Frequency The frequency of the backup schedule. Valid values: Periodic Backup and Single Backup.
    Note If you select Periodic Backup, you must set the Full Data Backup Recurrence, Start At, and Real-Time Transaction Log Backup parameters.
    Full Data Backup Recurrence

    The days of the week on which DBS runs the backup schedule. You can select one or more days of a week. Select at least one day of the week.

    Start At

    The start time of the backup. We recommend that you specify a point in time during off-peak hours. Example: 01:00.

    Note If a previous full data backup is not complete at the start time of the next backup, DBS skips the next backup.
    Incremental backup

    Specifies whether to enable incremental backup.

    Note If you enable incremental backup, make sure that the binary logging feature is enabled for the database that you want to back up.

    This parameter is displayed only if you set the Full-scale Backup Frequency parameter to Periodic Backup.

    Maximum Concurrent Threads for Full Data Backup

    The maximum number of concurrent threads that are available for a full backup. You can set this parameter to adjust the backup speed. For example, reduce the number of backup threads to minimize impacts on the database.

    The maximum number of actual concurrent threads varies based on backup schedule specifications. For more information, see How do I change the maximum backup speed?

    Read speed limit

    The limit on the disk I/O. You can set the limit based on your business requirements. Default value: 0, which indicates that the disk I/O is not limited.

    Backup network speed limit

    The limit on the network bandwidth. You can set the limit based on your business requirements. Default value: 0, which indicates that the network bandwidth is not limited.

    Incremental Backup Interval

    The interval at which incremental backup is performed. DBS performs incremental backup based on your settings. If you set the interval to 10 minutes, DBS performs an incremental backup every 10 minutes.

    This parameter is displayed only if you set the Incremental backup parameter to Enable.

    Enable compression Specifies whether to enable compression during backup. Valid values:
    • Enable: recommended. Data is compressed during a backup to reduce storage space.
    • Disable: Data is not compressed during a backup.
    Compression algorithm The algorithm used to compress data. Valid values:
    • GZIP: This is the default value.
    • LZ4

    This parameter is displayed only if you set the Enable compression parameter to Enable.

  7. In the Edit Lifecycle step, configure the lifecycle for full backup data in the Configure Full Data Backup Lifecycle section.
    If you set the Incremental backup parameter to Enable in Step 6, you must configure the lifecycle for incremental backup data. For more information about the lifecycle rules of backup data, see How do I manage the lifecycle rules of backup sets?
  8. After the preceding configurations are complete, click Precheck in the lower-right corner of the page.
  9. If the Precheck Passed message appears, click Start Task.
    Figure 1. Precheck the physical backup of a MySQL database
    Precheck the physical backup of a MySQL database
    Note When the state of the backup schedule changes to Running, the backup schedule takes effect. You can view the backup task on the Backup Schedules page. For more information, see View a backup schedule.

What to do next