Help Center/ TaurusDB/ User Guide/ Data Restorations/ Restoring a DB Instance to a Point in Time
Updated on 2024-11-06 GMT+08:00

Restoring a DB Instance to a Point in Time

Scenarios

You can restore a DB instance to a specified point in time.

The most recent full backup will be downloaded from OBS for restoration. After the restoration is complete, incremental backups will be replayed to the specified point in time. The time required depends on the amount of data to be restored.

Precautions

  • Data can be restored to a new, the original, or an existing DB instance.
  • Keep your account balance above zero so that backups can be restored to a new DB instance. You will be billed for the new DB instance.
  • Do not run the reset master command on DB instances within their lifecycle. Otherwise, an exception may occur when restoring a DB instance to a specified point in time.
  • Data on the original DB instance will be overwritten and the original DB instance will be unavailable during the restoration.
  • Restoring to an existing DB instance will overwrite data and reset the root password. The existing DB instance is unavailable during the restoration. DB instances will not be displayed unless they have the same DB engine type, version, and table name case sensitivity as the original DB instance.
  • If the original password of the existing DB instance cannot be used to connect to the database after the restoration, you can reset the password.
  • Once encrypted backup is enabled for your DB instance, data cannot be restored to an existing DB instance, even if encrypted backup is disabled later.
  • Ensure that the storage space of the selected DB instance is at least that of the original DB instance. Otherwise, data will not be restored.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > GaussDB(for MySQL).
  4. On the Instances page, click the instance name.
  5. In the navigation pane, choose Backups. On the displayed page, click Restore to Point in Time.

    Figure 1 Restoring to a point in time

  6. Select the restoration date and time range, enter a time point within the selected time range, and select a restoration method. Then, click OK.

    If you have enabled operation protection, click Start Verification in the Restore DB Instance dialog box. On the displayed page, click Send Code, enter the obtained verification code, and click Verify. The page is closed automatically.

    For details about how to enable operation protection, see Identity and Access Management User Guide.

    • Restoring the backup to a new DB instance
      1. Set Restoration Method to Create New Instance and click OK.
        Figure 2 Restoring to a new DB instance
      2. On the displayed page, set required parameters and click Next.
        • The region, DB engine, and DB engine version are the same as those of the original DB instance and cannot be changed.
        • The default database port is 3306.
        • To synchronize database parameters of the original DB instance, select Original DB instance parameter template.
          • If the original DB instance is deleted, the database parameters of the original DB instance cannot be synchronized using backups.
          • When you synchronize the database parameters of the original DB instance, the following parameters cannot be synchronized and you need to manually modify them after the DB instance is restored.

            innodb_write_io_threads

            innodb_read_io_threads

            max_connections

            innodb_log_buffer_size

            innodb_parallel_read_threads

            temptable_max_ram

            threadpool_size

            innodb_buffer_pool_size

            innodb_page_cleaners

      • Other settings are the same as those of the original DB instance by default but can be modified. For details, see Buying a DB Instance.
    • Restoring the backup to the original DB instance
      Figure 3 Restoring to the original DB instance
      1. Set Restoration Method to Restore to Original, select the confirmation check box, and click Next.
      2. Confirm the task details and click OK.

        Data on the original DB instance will be overwritten and the original DB instance will be unavailable during the restoration.

    • Restoring the backup to an existing DB instance
      Figure 4 Restoring to an existing DB instance
      1. Set Restoration Method to Restore to Existing, select the confirmation check box, and click Next.
      2. Confirm the task details and click OK.
        • Restoring to an existing DB instance will overwrite data and reset the root password. The existing DB instance is unavailable during the restoration. DB instances will not be displayed unless they have the same DB engine type, version, and table name case sensitivity as the original DB instance.
        • The restored DB instance contains the data and account information of the original DB instance, but does not contain the parameter settings of the original DB instance.
        • If the original password of the existing DB instance cannot be used to connect to the database after the restoration, you can reset the password.

  7. View the restoration results.

    • Restoring the backup to a new DB instance: A new DB instance is created, where data is restored based on the point in time when the backup was created. When the instance status changes from Creating to Available, the restoration is complete. The new DB instance is independent from the original one. If you want to offload read pressure from the primary node, create one or more read replicas for the new DB instance.

      After the restoration, a full backup will be automatically triggered.

    • Restoring the backup to the original DB instance: When the instance status changes from Restoring to Available, the restoration is complete.
    • Restoring the backup to an existing DB instance: When the instance status changes from Restoring to Available, the restoration is complete.