To restore the data of an AnalyticDB for MySQL cluster or perform business testing, such as stress testing, in an environment that simulates real-world scenarios, you can clone an AnalyticDB for MySQL cluster to create a new cluster for subsequent operations.
Prerequisites
An AnalyticDB for MySQL Data Lakehouse Edition or Data Warehouse Edition cluster is created.
The source cluster does not have Data Transmission Service (DTS) migration tasks in progress.
NoteYou can log on to the DTS console and go to the Data Migration page to view the statuses of migration tasks of the source cluster.
If you want to restore cluster data to a specific point in time, make sure that the log backup feature is enabled for the source cluster.
If you want to restore cluster data from backup sets, make sure that the source cluster has at least one backup set.
Usage notes
The following table describes the AnalyticDB for MySQL editions that support cross-account cloning and cross-region cloning.
Feature | Enterprise Edition | Basic Edition | Data Lakehouse Edition | Data Warehouse Edition |
Cross-account cloning | ✖️ | ✖️ | ✖️ | ✔️ |
Cross-region cloning | ✖️ | ✖️ | ✔️ | ✖️ |
Take note of the following items:
When you clone a Data Warehouse Edition cluster, you cannot change the mode of the cluster. For example, you cannot clone a Data Warehouse Edition cluster in reserved mode to create a Data Warehouse Edition cluster in elastic mode.
When you clone a cluster across regions, both the source and new clusters must be deployed within Chinese mainland regions or within regions outside the Chinese mainland. For example, you cannot clone a cluster between a Chinese mainland region and a region outside the Chinese mainland.
Data cloning scope
You can clone the following data:
The database account and password of the source cluster.
The data that is written to the source cluster before the clone operation starts.
The following data cannot be cloned: the whitelist settings of the source cluster.
Billing rules
You are charged fees for purchasing a new cluster. For more information, see Pricing for Data Lakehouse Edition and Pricing for Data Warehouse Edition.
Amount of time required for restoration
The following estimation methods and examples are for reference only.
Restoration from backup sets
Restoration to a point in time
Procedure
Clone a cluster within an Alibaba Cloud account
Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters.
On the Clusters page, click an edition tab. Find the cluster that you want to clone and choose More > Restore Cluster in the Actions column.
Configure the parameters that are described in the following table.
Parameter
Description
Billing Method
The billing method of the new cluster.
Clone Across Alibaba Cloud Accounts
Specifies whether to clone the cluster across Alibaba Cloud accounts. Select No.
Source Cluster
The ID of the cluster that you want to clone. You do not need to specify this parameter.
Restore Mode
The method that is used to clone the cluster. Valid values:
Backup Set: clones data from a backup set to the new cluster.
Backup Point-in-time: clones data at a specific point in time to the new cluster.
Backup Set
The backup set that you want to restore.
NoteThe backup start time of each backup set is displayed. You can select the backup set that you want to restore based on the backup start time.
This parameter is available only if you set the Restore Mode parameter to Backup Set.
Backup Point-in-time
The point in time to which you want to restore data.
NoteThis parameter is available only if you set the Restore Mode parameter to Backup Point-in-time.
You can set this parameter to a point in time from 5 minutes to seven days before the current time.
Clone Across Regions
Specifies whether to clone the cluster across regions. Only Data Lakehouse Edition clusters support the cross-region cloning feature. For clusters of other editions, this parameter is automatically set to false.
Region
Zone
The region and zone in which you want to deploy the new cluster.
NoteWhen you clone a cluster within the same region, the source and new clusters must be deployed within the same region but can be deployed in different zones.
For example, if the source cluster resides in the China (Hangzhou) region, the Region parameter is automatically set to China (Hangzhou) for the new cluster. You do not need to specify this parameter.
Network Type
The network type of the new cluster. This parameter is automatically set to VPC. You do not need to specify this parameter.
VPC
vSwitch
The virtual private cloud (VPC) in which the new cluster is deployed and the vSwitch to which the new cluster is connected.
Activate PrivateLink
PrivateLink is used to connect your VPCs to the VPCs of Alibaba Cloud services to ensure secure and efficient private connections and prevent potential security risks that may arise from using public connections. You can create clusters only after you activate PrivateLink. Each Alibaba Cloud account needs to activate PrivateLink only once. You are not charged when you activate PrivateLink.
NoteIf you are not prompted to activate PrivateLink, PrivateLink is already activated and you do not need to select the check box.
Disk Encryption
If you select Disk Encryption, the system encrypts data on each data disk of your cluster based on Elastic Block Storage (EBS). This way, your data cannot be decrypted even if the data is leaked.
Configure the Edition and corresponding parameters and click Buy Now in the lower-right corner of the page.
Perform the subsequent purchase operations as prompted based on the Product Type parameter of the source cluster.
Approximately 20 minutes after you complete the payment, you can view the new cluster on the Clusters page.
Clone a cluster across Alibaba Cloud accounts
You can clone only Data Warehouse Edition clusters across Alibaba Cloud accounts.
Log on to the Resource Access Management (RAM) console with the Alibaba Cloud account of the source cluster. Configure RAM authorization to ensure that other Alibaba Cloud accounts can read the AnalyticDB for MySQL resources of the source Alibaba Cloud account.
Create a RAM role. For more information, see Create a RAM role for a trusted Alibaba Cloud account.
NoteSelect Other Alibaba Cloud Account for the Select Trusted Alibaba Cloud Account parameter and enter the ID of a different Alibaba Cloud account. You can log on to the Account Center console to view the Alibaba Cloud account ID on the Security Settings page.
Attach the AliyunADBReadOnlyAccess policy to the RAM role. For more information, see Grant permissions to a RAM role.
Modify the trust policy. For more information, see Edit the trust policy of a RAM role.
{ "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "RAM": [ "acs:ram::testAccountID:root" ], "Service": [ "testAccountID@ads.aliyuncs.com" ] } } ], "Version": "1" }
NoteReplace the value of the testAccountID parameter with the ID of a different Alibaba Cloud account.
Log on to the AnalyticDB for MySQL console with a different Alibaba Cloud account. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters.
On the Clusters page, click the Data Warehouse Edition tab.
Find a Data Warehouse Edition cluster and choose More > Restore Cluster in the Actions column.
Both the preceding cluster and source cluster must be in elastic mode or reserved mode. If the existing clusters do not meet this requirement, you must create a new cluster. For more information, see Create a Data Warehouse Edition cluster.
Configure the parameters that are described in the following table.
Parameter
Description
Billing Method
The billing method of the new cluster.
Clone Across Alibaba Cloud Accounts
Specifies whether to clone the cluster across Alibaba Cloud accounts. Select Yes.
Cross-account UID
The UID of the Alibaba Cloud account of the source cluster.
Cross-account Role
The name of the RAM role that is created in Step 1.
Cross-account Cluster ID
The ID of the source cluster.
Cross-account Backup Set ID
The ID of the backup set. You do not need to specify this parameter.
Source Cluster
The ID of the cluster that you want to clone. You do not need to specify this parameter.
NoteWhen you clone a cluster across Alibaba Cloud accounts, this parameter is irrelevant and can be ignored.
Restore Mode
The method that is used to clone the cluster. Valid values:
Backup Set: clones data from a backup set to the new cluster.
Backup Point-in-time: clones data at a specific point in time to the new cluster.
NoteWhen you clone a cluster across Alibaba Cloud accounts, this parameter is irrelevant and can be ignored.
Backup Set
The backup set that you want to restore.
NoteThis parameter is available only if you set the Restore Mode parameter to Backup Set. When you clone a cluster across Alibaba Cloud accounts, this parameter is irrelevant and can be ignored.
The backup start time of each backup set is displayed. You can select the backup set that you want to restore based on the backup start time.
Backup Point-in-time
The point in time to which you want to restore data.
NoteThis parameter is available only if you set the Restore Mode parameter to Backup Point-in-time. When you clone a cluster across Alibaba Cloud accounts, this parameter is irrelevant and can be ignored.
You can set this parameter to a point in time from 5 minutes to seven days before the current time.
Edition
The edition of the new cluster. This parameter is automatically set to Data Warehouse Edition. You do not need to specify this parameter.
Region
Zone
The region and zone in which you want to deploy the new cluster.
NoteWhen you clone a cluster within the same region, the source and new clusters must be deployed within the same region but can be deployed in different zones.
For example, if the source cluster resides in the China (Hangzhou) region, the Region parameter is automatically set to China (Hangzhou) for the new cluster. You do not need to specify this parameter.
Network Type
The network type of the new cluster. This parameter is automatically set to VPC. You do not need to specify this parameter.
VPC
vSwitch
The virtual private cloud (VPC) in which the new cluster is deployed and the vSwitch to which the new cluster is connected.
Activate PrivateLink
PrivateLink is used to connect your VPCs to the VPCs of Alibaba Cloud services to ensure secure and efficient private connections and prevent potential security risks that may arise from using public connections. You can create clusters only after you activate PrivateLink. Each Alibaba Cloud account needs to activate PrivateLink only once. You are not charged when you activate PrivateLink.
NoteIf you are not prompted to activate PrivateLink, PrivateLink is already activated and you do not need to select the check box.
Disk Encryption
If you select Disk Encryption, the system encrypts data on each data disk of your cluster based on Elastic Block Storage (EBS). This way, your data cannot be decrypted even if the data is leaked.
Configure the Edition and corresponding parameters and click Buy Now in the lower-right corner of the page.
Perform the subsequent purchase operations as prompted based on the Product Type parameter of the source cluster.
Approximately 20 minutes after you complete the payment, you can view the new cluster on the Clusters page.
(Optional) If you do not need to use the cluster created in Step 4 after the clone operation is complete, release the cluster at the earliest opportunity. For more information, see Delete or unsubscribe from a cluster.
What to do next
After the new cluster is created, you can connect to the new cluster to verify data. After you check the data integrity, you can perform operations such as business testing on the new cluster. For more information, see Connect to an AnalyticDB for MySQL cluster.