Help Center/ GaussDB/ User Guide/ Data Restoration/ Restoring a GaussDB Database or Table Using a Backup File
Updated on 2025-08-18 GMT+08:00

Restoring a GaussDB Database or Table Using a Backup File

Scenarios

You can use an instance-level automated or manual backup to restore data of specified databases or tables to the point in time when the backup was created. This operation restores data in specified databases or tables.

You can use a table-level automated or manual backup to restore data in tables to the point in time when the backup was created. This operation restores data only in specified tables.

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

Precautions

  • Only databases and tables in instances of version V2.0-3.200 or later can be restored.
  • Restoration will fail if the instance is in the Abnormal, or Storage full state.
  • Backup data cannot be restored across major versions. For example, backup data of an instance of version V2.0-3.200.x can only be restored to version V2.0-3.200.y.
  • A maximum of 100 databases or tables can be restored at the same time. If there are more than 100 databases or tables, you are advised to use instance-level restoration.
  • The table names in a given database and schema as well as the database names must be different before and after the restoration.
  • Table-level restoration does not support column-store tables, user-defined tables, synonym tables, temporary tables (including global tables), unlogged tables, tables of private users, and tables of ledger databases.
  • Currently, only heap data, index data, and auto-increment column data related to tables can be restored. Other data related to tables, such as foreign key information, triggers, and SQL throttling rules, cannot be restored.
  • After table-level restoration, row-level access control and dynamic masking information will be lost.
  • System databases (postgres, template0, template1, templatem, templatea, and templatepdb) and their tables cannot be selected for database- and table-level restoration.
  • System schemas (for example, public) and their tables cannot be selected for database- and table-level restoration.
  • M-compatible databases and their tables cannot be selected for database- and table-level restoration.
  • Single-replica instances do not support database- and table-level backup and restoration.
  • Snapshot-based backups cannot be used to restore databases or tables.
  • If transparent data encryption (TDE) is enabled for an instance and the instance version is earlier than V2.0-8.200, database- and table-level restoration is not supported.
  • Restoring a database or table using a backup file is only available to whitelisted users. To request this feature, submit a service ticket.
  • In addition to table-level full backups and incremental backups, the system 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). Note that the backup completion time does not represent the data consistency point that can be specified when this backup set is used to restore data. (Generally, the data consistency point is within several minutes before the backup completion time.) If you have strict requirements on data consistency after restoration, restore data to a specified point in time.
  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. In the navigation pane, choose Backups. On the Backups page, locate the backup to be restored and click Restore in the Operation column.

    • If the selected backup is an instance-level backup, you can restore data to specified databases or tables.
    • If the selected backup is a table-level backup, you can only restore data to specified tables.

    Alternatively, on the Instances page, click the instance name to go to the Basic Information page. In the navigation pane on the left, choose Backups. Click Instance Backup or Table Backup under Full Backups. On the displayed page, locate the backup to be restored and click Restore in the Operation column.

  5. Set Restoration Method to Create New Instance and click OK.

    When you attempt to restore data to tables, a maximum of 200 tables can be displayed for Backup Tables by default. If the required table is not displayed, click the + icon in the upper right corner to add a custom table. (You can also use this method to add required tables if the instance is faulty or deleted.)

    • The new DB instance must have the same major version as the original instance when it was backed up. For example, backup data of an instance of version V2.0-3.200.x can only be restored to version V2.0-3.200.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 specifications of the new instance are the same as those of the original instance. You can configure higher specifications for the new instance. For instances of version V2.0-8.200 or later, an instance backup can be restored to an instance with lower specifications than the original instance. (Minimum specifications for the destination instance: 8 vCPUs | 32 GB)
    • The backup media, CPU architecture, OS type and version, instance type (distributed or centralized), deployment model, replica consistency protocol, and transaction consistency settings of the new instance must be the same as those of the original instance to be restored.
    • If there are M-compatible databases in the instance to be restored, the Tables Names in M-compatible Databases parameter of the new instance must be set to the same value as that of the original instance. The default value is Case-sensitive.
    • Parameters of the original instance will not be automatically restored to the new instance. To use the original parameter settings, select the required parameter template for Parameter Template when creating an instance for restoring data to a new instance. After the new instance is created, click the instance name and manually change the parameter values on the Parameters page.

  6. On the displayed page, configure parameters of the new instance, select the table or database data to be restored, and click Create Now.
  7. View the restoration results.

    A new instance that contains the same databases or tables as the backup is created. When the instance status changes from Creating to Available, the restoration is complete.

    The new instance is independent from the original one.

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

    • If the selected backup is an instance-level backup, you can restore data to specified databases or tables.
    • If the selected backup is a table-level backup, you can only restore data to specified tables.

    Alternatively, on the Instances page, click the instance name to go to the Basic Information page. In the navigation pane on the left, choose Backups. Click Instance Backup or Table Backup under Full Backups. On the displayed page, locate the backup to be restored and click Restore in the Operation column.

  5. Set Restoration Method to Restore to Original, select the confirmation check box, and click Next.

    When you attempt to restore data to tables, a maximum of 200 tables can be displayed for Backup Tables by default. If the required table is not displayed, click the + icon in the upper right corner to add a custom table. (You can also use this method to add required tables if the instance is faulty or deleted.)
    • The instance version and node configuration must be the same as those of the original instance when the backup was created.
    • Databases and tables will be created on the target DB instance. During the restoration, the source database can be used properly.
    • You are advised to manually back up data before the restoration.
    • After a database (for example, db1) is restored to the original instance, you need to wait for the DB instance to automatically perform a full or differential backup before restoring the data of db1 using other restoration processes. The time to wait depends on the backup policy. During point-in-time restoration, if you select a time point that is later than when the current database-level restoration is complete but earlier than when the next backup is performed, db1 cannot be restored.

  6. On the Restore DB Instance page, select the data to be restored and click Submit.
  7. View the restoration results.

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

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

    • If the selected backup is an instance-level backup, you can restore data to specified databases or tables.
    • If the selected backup is a table-level backup, you can only restore data to specified tables.

    Alternatively, on the Instances page, click the instance name to go to the Basic Information page. In the navigation pane on the left, choose Backups. Click Instance Backup or Table Backup under Full Backups. On the displayed page, locate the backup to be restored and click Restore in the Operation column.

  5. Set Restoration Method to Restore to Existing, select the confirmation check box, select an existing instance, and click Next.

    When you attempt to restore data to tables, a maximum of 200 tables can be displayed for Backup Tables by default. If the required table is not displayed, click the + icon in the upper right corner to add a custom table. (You can also use this method to add required tables if the instance is faulty or deleted.)
    • Databases and tables will be created on the target instance. During the restoration, the databases on the instance can be used properly.
    • You are advised to manually back up data of the selected instance before the restoration.
    • The backup media, CPU architecture, OS type and version, instance type (distributed or centralized), deployment model, replica consistency protocol, transaction consistency, resource specifications, and failover priority settings of the selected instance must be the same as those of the original instance to be restored.
    • An existing instance cannot be selected as the restoration target if it is currently undergoing a full or differential backup. If the backup is not required, you can stop it before proceeding with the restoration.

  6. Confirm the backup task information and click OK.
  7. View the restoration results.

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