Help Center> Relational Database Service> User Guide> Working with RDS for PostgreSQL> Data Restorations> Restoring from Backup Files to RDS for PostgreSQL Instances
Updated on 2023-11-27 GMT+08:00

Restoring from Backup Files to RDS for PostgreSQL Instances

Scenarios

This section describes how to use an automated or manual backup to restore a DB instance to the status when the backup was created. The restoration is at the DB instance level.

Constraints

  • You can restore to new DB instances from backups only when your account balance is greater than or equal to $0 USD. You will pay for the new instance specifications.
  • RDS for PostgreSQL does not support restoration to the original DB instance. If you intend to restore to the original DB instance, restore to a new DB instance first and then change the IP address to that of the original DB instance.
  • Constraints on restoring data to an existing DB instance:
    • If you want to restore to an existing DB instance, submit a service ticket to the customer service to apply for the required permissions.
    • If the target existing DB instance has been deleted, data cannot be restored to it.
    • Restoring to an existing DB instance will overwrite data on it and cause the existing DB instance to be unavailable.
    • To restore backup data to an existing DB instance, the selected DB instance must be in the same VPC as the original DB instance and must have the same DB engine and the same or later version than the original DB instance.
    • Ensure that the storage space of the selected DB instance is greater than or equal to the storage space 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 a project.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Backups page, select the backup to be restored and click Restore in the Operation column.

    Alternatively, click the target DB instance on the Instances page. On the displayed page, choose Backups & Restorations. On the displayed page, select the backup to be restored and click Restore in the Operation column.

  5. Select a restoration method and click OK.

    RDS for PostgreSQL does not support restoration to the original DB instance. If you intend to restore to the original DB instance, restore to a new DB instance first and then change the IP address to that of the original DB instance.

    • Create New Instance
      Figure 1 Restoring to a new DB instance

      The Create New Instance page is displayed.
      • The DB engine and engine version of the new instance are the same as those of the original instance.
      • Storage space of the new DB 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.
      • Other settings are the same as those of the original DB instance by default and can be modified. For details, see Buying a DB Instance.
      Figure 2 Creating a new instance

    • Restore to Existing
      1. Select "I acknowledge that restoring to an existing DB instance will overwrite data on the instance and will cause the existing DB instance to be unavailable during the restoration. Only DB instances that can be used as target instances for the restoration are displayed here. Eligible instances must have the same DB engine type, version, and at least as much storage as the instance being restored." and click Next.
      2. Confirm the information and click OK.
      3. If you have enabled operation protection, click Send Code in the displayed Identity Verification dialog box and enter the obtained verification code. Then, click OK.
      4. Two-factor authentication improves the security of your account and cloud product. For details about how to enable operation protection, see Identity and Access Management User Guide.
      Figure 3 Restoring to an existing DB instance

  6. View the restoration result. The result depends on which restoration method was selected:

    • Create New 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. If you need read replicas to offload read pressure, create one or more for the new DB instance.

      After the new instance is created, a full backup will be automatically triggered.

    • Restore to Existing

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

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

Follow-up Operations

After the restoration is successful, you can log in to the DB instance for verification.

Backup data cannot be restored to original RDS for PostgreSQL DB instances. If you need to restore data to your original DB instance, restore backup data to a new DB instance and then migrate the data to the original instance using DRS or change the floating IP address of the new DB instance to that of the original instance.