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

Restoring a Backup File to a DB Instance

Scenarios

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

Data can be restored to a new DB instance, an existing DB instance, or the original DB instance.

Constraints

  • Restoration will fail if the instance is in the Abnormal, or Storage full state.
  • GaussDB currently only supports restoration between DB instances running the same major version. For example, backup data can only be restored from version 1.4.x to version 1.4.y.

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 Backups page, locate the backup to be restored and click Restore in the Operation column.

    Alternatively, click the name of the target instance on the Instances page. In the navigation pane, choose Backups. On the Full Backups page, click the Instance Backup tab, and click Restore in the Operation column of the backup to be used for restoration.

  5. 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.
    • In addition to full backups and incremental backups, the system also backs up incremental log files to ensure data consistency. It takes some time to back up and upload incremental log files (The time depends on the network and OBS traffic control). If you have strict requirements on data consistency after restoration, you can restore data to a specified point in time.
    • 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 storage space for a single shard starts from 40 GB and can be increased at a step of 4 GB.
      • 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.

  6. 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, an instance-level 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, an instance-level full backup will be automatically triggered.