Help Center> GaussDB> User Guide> Data Restoration> Restoring a DB Instance to a Specific Point in Time
Updated on 2024-05-07 GMT+08:00

Restoring a DB Instance to a Specific Point in Time

Scenarios

You can use an instance-level automated backup to restore a GaussDB instance to a specified point in time.

You can restore backup data to the original GaussDB instance, an existing instance, or a new one.

Precautions

  • Only DB instances of version 2.1 or later can be restored to any point in time. Single-replica instances are not supported.
  • If nodes are being added, versions are being upgraded, or data is being restored to an existing instance, the instance cannot be restored a specific point in time.
  • If a DB instance is faulty or a CN is removed, archive logs cannot be generated and the instance cannot be restored to a specific point in time
  • If you restore backup data to a new DB instance:
    • The DB engine and major version are the same as those of the original DB instance and cannot be changed.
    • The administrator password needs to be reset.
  • If you restore backup data to the original DB instance, data on the original instance will be overwritten and the original DB instance will be unavailable during the restoration. Additionally, log archiving stops. After the restoration is complete, the Confirm Data Integrity button is displayed. Before clicking Confirm Data Integrity, you can restore data for multiple times. Once data integrity has been confirmed, any logs archived after the point in time data was restored from will be lost, but normal log archiving will be restored.
  • When a DB instance is deleted, all archive logs are deleted by default and cannot be retained. After an instance is deleted, it cannot be rebuilt or restored to any point in time.

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.
  4. On the Instances page, click the name of the target instance to go to the Basic Information page.
  5. In the navigation pane on the left, choose Backups. On the displayed page, click Restore to Point in Time.
  6. Click OK.

    • If parallel restoration is enabled, all replicas in shards download backup data from the OBS server at the same time during the restoration. Compared with serial restoration by default, parallel restoration requires N times as much bandwidth, where N is the number of replicas of each shard. If there is not enough available bandwidth, the restoration will slow down. If there are more than 5 shards in the instance to be restored, you are advised to consult the O&M personnel about the bandwidth available for the OBS server and if enabling parallel restoration is appropriate.
    • Primary/standby instances support only parallel restoration.
    • Parallel restoration cannot be enabled if the DB engine version is earlier than 1.4.
    • Restoring data to a new DB instance:
      • The original and new DB instances must have the same major version. For example, backup data can only be restored from version 1.4.x to version 1.4.y.
      • The storage space of the new instance is the same as that of the original DB instance by default and the new instance must be at least as large as the original DB instance.
      • The administrator password needs to be reset.
      • By default, the instance specifications of the new instance are the same as those of the original instance. To change the instance specifications, ensure that the instance specifications of the new instance are at least those of the original instance.
      • The new DB instance has the same node configurations as the original DB instance.

      Configure the basic information about the new instance, click Next, and then click Submit.

    • Restoring data to the original DB instance
      • The instance version and node configuration must be the same as those of the original DB instance.
      • Restoring to the original DB instance will overwrite all data on it and cause the DB instance to be unavailable during the restoration.
      • You are advised to manually back up data before the restoration.
      • If you use a backup created before advanced compression is enabled to restore data to the current instance, you must enable this feature for the instance again.
    • Restoring data to an existing DB instance
      • The instance version and node configuration must be the same as those of the original DB instance.
      • Restoring to an existing DB instance will overwrite all data on it and cause the DB instance to be unavailable during the restoration.
      • Manually backing up data of the selected DB instance before the restoration.

  7. View the restoration results.

    • Restoring data to a new DB instance

      A new DB instance is created using the backup data. The status of the DB instance changes from Creating to Available.

      The new DB instance is independent from the original one.

    • Restoring data to the original DB instance

      On the Instances page, the status of the DB instance changes from Restoring to Available. After the restoration is complete, a full backup will be automatically triggered.

      After the restoration is complete, check whether the restored data is consistent with the time point to which the data is restored. If yes, click Confirm Data Integrity on the Backups page. Before confirming data integrity, you can restore data for multiple times. Once data integrity has been confirmed, any logs archived after the point in time data was restored from will be lost, but normal log archiving will be restored.

    • Restoring data to an existing DB instance

      On the Instances page, the status of the DB instance changes from Restoring to Available. After the restoration is complete, a full backup will be automatically triggered.