The topic describes how use backups to restore data to ApsaraDB RDS for PostgreSQL instances.

You can restore ApsaraDB RDS for PostgreSQL data by backup set or by time. The procedure is as follows:
  1. Restore data to a new instance (formerly known as cloning an instance).
  2. Log on to the new instance to verify the data.
  3. Migrate the data to the original instance.

Precautions

  • The new instance must have the same whitelist, backup, and parameter settings as the original instance.
  • The new instance must have the same data and account information as the backup set or instance at the time point.

Pricing

It is the same as purchasing a new instance. For more information, see Pricing.

Prerequisites

The original instance must meet the following conditions:

  • It is running and is not locked.
  • It is not undergoing any migration tasks.
  • To restore data by time, you must make sure that the log backup function is enabled.
  • To restore data by backup set, you must make sure that the original instance has at least one backup set.

Restore data to a new instance

PostgreSQL 11 High-availability Edition (cloud disk) and PostgreSQL 10 High-availability Edition (cloud disk)

  1. Log on to the new ApsaraDB RDS for PostgreSQL console.
  2. In the upper-left corner of the page, select the region where the instance is located.

  3. Find the instance and click the instance ID.
  4. In the left-side navigation pane, choose Backup and Restoration > Data Backup.
  5. In the upper-left corner of the page, click Clone Instance.
  6. On the page that appears, select a billing method for the new instance.
    • Subscription You are charged when you create an instance. For long-term usage, subscription instances can be more cost-effective than pay-as-you-go instances. The longer the subscription period, the greater the discount.
    • Pay-As-You-Go: You are charged by hour. Pay-as-you-go instances can be more cost-effective over a short-term period. You can release the instance if you no longer need it.
    Note Pay-as-you-go instances can be changed to subscription instances. Subscription instances cannot be changed to pay-as-you-go instances.
  7. Configure parameters for the new instance.
    Parameter Description
    Restore Mode
    • By Time: You can restore data to any point in time within the retention period of log backup. To view or modify the retention period of log backup, see Back up RDS for PostgreSQL data.
    • By Backup Set
    Note By Time is displayed only if the log backup function is enabled.
    Primary Zone

    The ID of the primary zone to which the RDS instance belongs.

    • A zone is an independent physical area located within a region. There are no substantive differences between the zones.
    • You can deploy RDS and ECS instances in the same zone or in different zones.
    • You only need to select a primary zone. The system automatically selects a secondary zone.
    Instance Type Each instance type provides a specific number of CPU cores, memory, maximum number of connections, and maximum IOPS. For more information, see Instance types.

    RDS provides the following instance families:

    • General-purpose (including test and entry-level instances): A general-purpose instance uses dedicated allocations of memory and I/O resources while sharing CPU and storage resources with other general-purpose instances on the same server.
    • Dedicated: A dedicated instance uses dedicated allocations of CPU, memory, storage, and I/O resources.
    • Dedicated host: A dedicated instance type with maximum specifications. Instances of this type occupy the CPU, memory, storage, and I/O resources of the entire server.

    For example, an instance with 4 cores and 16 GB memory indicates a general-purpose instance. An instance with 8 cores and 32 GB of dedicated memory indicates a dedicated instance. An instance with 30 cores and 220 GB of dedicated memory indicates a dedicated host instance.

    Virtual Private Cloud (VPC)

    VSwitch

    • Select the VPC and VSwitch if you have created a VPC that meets your network plan.
    • Otherwise, use the default VPC and VSwitch.
    Storage Type Standard SSD or Enhanced SSD. For more information, see Storage types.
    Capacity The storage space of the instance, including the space for data, system files, binlog files, and transaction files.
  8. Configure the duration for subscription instances only, select the check box of ApsaraDB RDS for PostgreSQL Agreement of Service, and click Pay.

PostgreSQL 10 High-availability Edition (local disk), PostgreSQL 10 Basic Edition, and PostgreSQL 9.4

  1. Log on to the ApsaraDB for RDS console.
  2. Select the region where the instance is located.

  3. Click the ID of the instance.
  4. In the left-side navigation pane, select Backup and Restoration.
  5. In the upper-right corner of the page, click Restore Database (Previously Clone Database).
  6. On the page that appears, select a billing method for the new instance.
    • Pay-As-You-Go: You are charged by hour. Pay-as-you-go instances can be more cost-effective over a short-term period. You can release the instance if you no longer need it.
    • Subscription: You are charged when you create the instance. For long-term usage, subscription instances can be more cost-effective than pay-as-you-go instances. The longer the subscription period, the greater the discount.
    Note Pay-as-you-go instances can be changed to subscription instances. Subscription instances cannot be changed to pay-as-you-go instances.
  7. Configure parameters for the new instance.
    Parameter Description
    Restore Mode
    • By Time: You can restore data to any point in time within the retention period of log backup. To view or modify the retention period of log backup, see Back up RDS for PostgreSQL data.
    • By Backup Set
    Note By Time is displayed only if the log backup function is enabled.
    Edition
    • RDS for PostgreSQL 10 Basic Edition. The Basic Edition is of a single-node structure that separates computing from storage. This edition is cost-effective, but is not recommended for production environments.
    • RDS for PostgreSQL 9.4 High-availability Edition and PostgreSQL 10 High-availability Edition. A high-availability instance includes one primary node and one secondary node, which is a classic high-availability architecture.
    For more information, see Product series overview.
    Zone

    The zone of the instance. A zone is an independent physical area located within a region. There are no substantive differences between the zones.

    You can choose to create RDS and ECS instances in the same zone or in different zones.

    High-availability instances in some regions can be deployed in multiple zones, for example, Zone F + Zone G. In this case, the high-availability instance is deployed across different zones, which provides a higher disaster recovery capability at no additional charge.

    Note The new instance is in the same region as the original instance and the region cannot be modified.
    Type

    The instance type. We recommend that you select a type and storage space that are larger than those of the primary instance. Otherwise, the data restoration may take a long time due to performance limitations.

    Each instance type provides a specific number of CPU cores, memory, maximum number of connections, and maximum IOPS. For more information, see Instance type list.

    RDS provides the following instance families:
    • General-purpose: A general-purpose instance uses dedicated allocations of memory and I/O resources while sharing CPU and storage resources with other general-purpose instances on the same server.
    • Dedicated: A dedicated instance uses dedicated allocations of CPU, memory, storage, and I/O resources.
    • Dedicated host: A dedicated instance type with maximum specifications. Instances of this type occupy the CPU, memory, storage, and I/O resources of the entire server.
    For example, an instance with 8 cores and 32 GB memory indicates a general-purpose instance. An instance with 8 cores and 32 GB of dedicated memory indicates a dedicated instance. An instance with 30 cores and 220 GB of dedicated memory indicates a dedicated host instance.
    Capacity The storage space of the instance, including the space for data and system files.
    Network Type
    • Classic Network
    • VPC (recommended): Virtual Private Cloud. A VPC is an isolated virtual network with higher security and performance than a classic network.
      Note
      • Select the VPC and VSwitch if you have created a VPC that meets your network plan.
      • Otherwise, use the default VPC and VSwitch.
  8. Configure the number of instances and their duration.
  9. Click Buy Now.
  10. Select and Product Terms of Service and Service Level Notice and Terms of Use, and click Pay Now.

Log on to the new instance and verify the data

For more information about logging on to an instance, see Connect to an instance.

Migrate data to the original instance

After you verify the data in the new instance, you can migrate the data that you require from the new instance to the original instance.

Precautions

You cannot perform DDL operations during data migration. Otherwise, the migration may fail.

Procedure

  1. Log on to the DTS console.
  2. In the left-side navigation pane, select Data Migration.
  3. In the upper-right corner of the page, click Create Migration Task.
  4. Enter the task name and the information of source and destination databases. The following table describes the parameters.
    Section Parameter Description
    - Task Name DTS automatically generates a name for each task. We recommend that you change it to a descriptive name to help identify the task.
    Source Database Instance Type Select RDS Instance.
    Instance Region Select the region where the new instance is located.
    RDS Instance ID Select the ID of the new instance.
    Database Name Enter the name of the database that you need to migrate in the new instance.
    Note If you need to migrate multiple databases, you must create a migration task for each database.
    Database Account Enter the premier account of the new instance.
    Database Password Enter the password of the premier account.
    Destination Database Instance Type Select RDS Instance.
    Instance Region Select the region where the original instance is located.
    RDS Instance ID Select the ID of the original instance.
    Database Name Enter the database to be migrated in the original instance.
    Database Account Enter the premier account of the original instance.
    Database Password Enter the password of the premier account.
    Note The values of Instance Type and RDS Instance ID determine which parameters you need to specify.

    Task screenshot
  5. In the lower-right corner of the page, click Set Whitelist and Next.
  6. Select Migrate object structure and Migrate existing data.
  7. In the left-side Migration objects section, select the objects that you need to migrate, and click > to add them to the right-side Selected objects section.
    Note DTS will perform object name conflict check. If an object in the destination RDS instance has the same name as the object to be migrated, the migration fails.

    Solution:

    • In the Selected objects section, move the pointer over the object and click Edit to modify the object name.
    • Rename the object in the destination database.


  8. Click Precheck and Start.
  9. If the precheck fails, perform this step. If the precheck succeeds, go to step 11.

    If the precheck fails, click the icon next to the check item with check result as Failed to check the failure details as shown in the following figure. After troubleshooting, select the current migration task on the Migration task list page and perform a precheck again.



  10. After all the errors are fixed, on the Migration task list page, select the newly created migration task and click Start.


  11. After the precheck succeeds, click OK.
  12. On the Confirm Purchase Configuration page, confirm configuration information and select Service Terms of Data Transmission (Pay-As-You-Go), and click Buy and Start Now.