Help Center/ GaussDB(for MySQL)/ User Guide/ Data Restorations/ Restoring a DB Instance from Backups
Updated on 2024-11-06 GMT+08:00

Restoring a DB Instance from Backups

Scenarios

You can use an automated or manual backup to restore data to the point in time when the backup was created. The restoration is at the instance level.

A full backup will be downloaded from OBS for restoration. The time required depends on the amount of data to be restored.

Prerequisites

There is an automated or manual backup available for the DB instance. If you want to restore a deleted DB instance, you need to ensure that there is a manual backup because automated backups are deleted along with the DB instance.

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.
  • 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 Backups page, locate the backup to be restored and click Restore in the Operation column.
  5. Select where you want to restore the backup to:

    • Restoring the backup to a new DB instance
      1. Set Restoration Method to Create New Instance and click OK.
        Figure 1 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.
        • 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
      1. Set Restoration Method to Restore to Original, select the confirmation check box, and click Next.
        Figure 2 Restoring to the original DB instance
      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
      1. Set Restoration Method to Restore to Existing, select the confirmation check box, and click Next.
        Figure 3 Restoring to an existing DB instance

      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.
        • 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.

  6. 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

      On the Instances page, when the instance status changes from Restoring to Available, the restoration is complete.

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

    • Restoring the backup to an existing DB instance

      On the Instances page, when the instance status changes from Restoring to Available, the restoration is complete. If the existing DB instance contains read replicas, the read replica status is the same as the existing DB instance status.

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