Full restoration is a method of restoring all historical data of a PolarDB cluster to a new cluster. After you verify the accuracy of the data in the new cluster, you can migrate the restored data to the original cluster. All historical data of a PolarDB cluster can be restored from a backup set or to an earlier point in time. This topic describes how to restore all historical data of a cluster to an earlier point in time.

Note

  • Only the data and account information of the original cluster can be restored to a new cluster. The parameters of the original cluster cannot be restored to the new cluster.
  • You can restore data to a specified point in time within a specific time range. The time range varies based on the Log Backups Retained For parameter in the backup settings. The default time range is 7 days.

Procedure

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the left-side navigation pane, choose Settings and Management > Backup and Restore.
  5. On the Backup and Restore page, click Point-in-time Restore.
    1
  6. On the Clone Instance page, select a billing method for the new cluster.
    • Subscription: Pay for the compute nodes when you create the cluster. You are charged by hour for the storage space that is occupied by the actual amount of data. The charges are deducted from your account balance on an hourly basis.
    • Pay-As-You-Go: An upfront payment is not required. You are charged by hour for the compute nodes and the storage space that is consumed by the actual amount of data. The charges are deducted from your account balance on an hourly basis.
  7. Configure the following parameters.
    Parameter Description
    Clone Source Type Select Backup Timepoint.
    Backup Timepoint Select the point in time to which you want to restore data.
    Note The time range within which data can be restored to a specified point in time varies based on the Log Backups Retained For parameter in the backup settings. The default time range is 7 days.
    Region This parameter is automatically set to the region of the original cluster. You do not need to change this value.
    Primary Availability Zone Select the primary zone where you want to deploy the new cluster.
    Note In regions that have two or more zones, PolarDB automatically replicates data to the secondary zones for disaster recovery.
    Network Type This parameter is automatically set to VPC. You do not need to change this value.
    VPC Select a VPC and a vSwitch for the new cluster. We recommend that you select the same VPC and vSwitch that are connected to the original cluster.
    Note Make sure that the PolarDB cluster and the ECS instance to be connected to the cluster are deployed in the same VPC. Otherwise, the cluster and the ECS instance cannot communicate over a VPC. As a result, the cluster performance is compromised.
    VSwitch
    Compatibility This parameter is automatically set to the value of Compatibility that is specified for the original cluster. You do not need to change this value.

    For example, if the value of Compatibility that is specified for the original cluster is MySQL 8.0, Compatibility is automatically set to MySQL 8.0 for the new cluster. The value of MySQL 8.0 specifies that the cluster is fully compatible with MySQL 8.0.

    Specification Type Select General-purpose or Dedicated for ApsaraDB PolarDB MySQL-compatible edition Cluster Edition. Valid values:
    • Dedicated: Computing resources such as CPUs that are allocated to each cluster are exclusive to the cluster. This improves the stability and reliability.
    • General-purpose: Idle computing resources such as CPUs are shared among clusters on the same server for cost-effectiveness.

    For more information about the comparison between the types of specifications, see Comparison between general-purpose and dedicated compute nodes.

    Note This parameter is available only if the edition of the original cluster is Cluster (2-16 Nodes) (Recommended).
    Node Specification Select a node specification. The maximum storage and performance of a cluster vary based on the node specification. For more information, see Specifications of compute nodes.
    Note We recommend that you select a node specification that is higher than the node specification of the original cluster. This ensures that the new cluster runs as expected.
    Nodes
    • If the edition of the original cluster is Cluster (2-16 Nodes) (Recommended), the number of nodes is automatically set to 2 for the new cluster. You do not need to change this value.
      Note By default, a new cluster of the Cluster Edition contains one primary node and one read-only node. After the new cluster is created, you can add only read-only nodes to the new cluster. Each cluster can contain a maximum of 15 read-only nodes. For more information, see Add or remove read-only nodes.
    • If the edition of the original cluster is Single Node (Starter) or Archive Database (High Compression Ratio), the number of nodes is automatically set to 1 for the new cluster. You do not need to change this value.
    Storage Cost You do not need to specify the required storage when you purchase the PolarDB cluster. You are charged for storage usage on an hourly basis. In addition, you can purchase storage plans based on your business requirements. For more information, see Purchase a storage plan.
    Cluster Name Enter the name of the new cluster. The name must meet the following requirements:
    • The name cannot start with http:// or https://.
    • The name must be 2 to 256 characters in length.

    If you do not configure this parameter, the system automatically generates a cluster name. You can change the cluster name after the new cluster is created.

    Purchase Plan Select a purchase plan for the new cluster.
    Note This parameter is available only if Billing Method is set to Subscription.
    Number Select the number of clusters that you want to purchase.
  8. Read and accept the terms of service, and complete the rest of the steps based on the billing method of the cluster.
    • Pay-as-you-go

      Click Buy Now.

    • Subscription
      1. Click Buy Now.
      2. On the Purchase page, confirm the information of the unpaid order and the payment method and click Purchase.
    Note After you complete the payment, it requires 10 to 15 minutes to create the cluster. Then, you can view the new cluster on the Clusters page.

What to do next

  1. Log on to the new cluster and verify data accuracy. For more information about how to log on to the cluster, see Connect to a cluster.
  2. Migrate data to the original cluster.

    After you verify the data on the new cluster, you can migrate the data from the new cluster back to the original cluster. For more information, see Migrate data between PolarDB for MySQL clusters.

    Note Data migration is a process of replicating data from a cluster to another cluster. During data migration, your services in the original cluster are not affected.

Related API operations

API operation Description
CreateDBCluster Restores the data of a PolarDB cluster.
Note You must set CreationOption to CloneFromPolarDB.