You can clone a source AnalyticDB for MySQL cluster to a new cluster to restore data or to simulate your production environment for tests, such as stress tests.
Prerequisites
If you restore a cluster to a point in time, make sure that log backup is enabled.
If you restore a cluster from a backup set, make sure that the source cluster has at least one backup set.
Limits
The following table describes the cross-account and cross-region cloning capabilities for different AnalyticDB for MySQL editions.
Feature
Enterprise Edition
Basic Edition
Data Lakehouse Edition
Data Warehouse Edition
Clone a cluster across accounts
✔️
✔️
✔️
✔️
Clone a cluster across regions
✔️
✔️
✔️
✖️
Cross-region cloning is not supported in the US (Silicon Valley) or US (Virginia) regions.
You cannot change the cluster mode when you clone a Data Warehouse Edition cluster. A cluster in reserved mode can be cloned only to another cluster in reserved mode, not to a cluster in elastic mode.
You cannot clone an Enterprise Edition cluster to a Basic Edition cluster.
Clusters in the Chinese mainland can be cloned only to other regions in the Chinese mainland. You cannot clone them to the China (Hong Kong) region or regions outside China.
Data cloning scope
Data that can be cloned:
Database accounts and passwords of the source cluster.
Data written to the source cluster before the clone operation starts.
Data that cannot be cloned: The whitelist configuration of the source cluster.
Costs
You are charged for the new cluster. For more information about the pricing of a new cluster, see Pricing of Enterprise Edition and Basic Edition clusters, Pricing of Data Lakehouse Edition clusters, and Pricing of Data Warehouse Edition clusters.
Backup and restoration duration
The estimation methods and examples for cluster backup and restoration duration in this topic are for reference only. The actual duration is displayed in the console.
Source type for cloning is Backup Set
Source type for cloning is Point in Time
Procedure
Clone a cluster within the same 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 the tab for the cluster edition. Find the target cluster and choose More > Restore Cluster in Same Region.
Set parameters such as Source Cluster for Cloning, Source Type for Cloning, Source Backup Set for Cloning, and Point in Time. The following table describes the parameters.
Parameter
Description
Billing Method
Select a billing method for the new cluster.
Cross-account Clone
Specifies whether to clone the cluster across Alibaba Cloud accounts. Select No.
Source Cluster For Cloning
The ID of the source cluster to be cloned. You do not need to select an ID.
Source Type For Cloning
Two source types are supported:
Backup Set: Clones data from the target backup set to the new cluster.
Point In Time: Clones data at the target Point In Time to the new cluster.
Source Backup Set For Cloning
Select the target backup set from the drop-down list.
NoteThe start time of each backup set is displayed. You can use this time to determine if it is the backup set you want to restore.
This parameter is available only when Source Type For Cloning is set to Backup Set.
Point In Time
Select a point in time.
NoteThis parameter is available only when Source Type For Cloning is set to Point In Time.
You can select a point in time within the last seven days, up to five minutes before the current time.
Cross-region Clone
Specifies whether to clone the cluster across regions. The default value is No.
NoteYou cannot clone a Data Warehouse Edition cluster across regions.
Region
Zone
Select the region and zone for the new cluster.
NoteWhen you clone a cluster within the same region, the new cluster must be in the same region as the source cluster, but they can be in different zones.
For example, if the source cluster is in the China (Hangzhou) region, the Region for the new cluster is fixed to China (Hangzhou) and does not need to be selected.
Network Type
This is fixed to VPC and does not need to be selected.
VPC
vSwitch
Select the VPC and vSwitch for the new cluster.
Automatically Enable PVL Service
PrivateLink establishes secure and stable private connections between a Virtual Private Cloud (VPC) and Alibaba Cloud services. This avoids potential security risks from accessing services over the public network. You must enable this service to create a cluster. Each Alibaba Cloud account needs to enable it only once. The service is free.
NoteIf the purchase page does not prompt you to enable the PVL service, it is already enabled and you do not need to select it.
Disk Encryption
After disk encryption is enabled, the system encrypts the entire data disk based on Elastic Block Storage. This protects your data security because even if a data backup is leaked, it cannot be decrypted.
Select a cluster Edition, configure cluster parameters, and then click Buy Now in the lower-right corner.
Based on the Product Type of the source cluster, follow the instructions in the console to complete the purchase.
After the payment is successful, wait about 20 minutes. You can then view the new cluster in the Cluster List.
Clone a cluster across accounts
Log on to the Resource Access Management (RAM) console using the Alibaba Cloud account of the source cluster. Configure RAM authorization to allow the destination Alibaba Cloud account to 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.
NoteWhen you configure the Select Trusted Alibaba Cloud Account parameter, select Other Alibaba Cloud Account and enter the Alibaba Cloud account ID of the destination account. You can log on to the Account Center to view the Account ID on the Overview page.
Grant the AliyunADBReadOnlyAccess permission to the RAM role. For more information, see Grant permissions to a RAM role.
Modify the trust policy. For more information, see Modify 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 testAccountID with the destination Alibaba Cloud account ID.
Use the destination Alibaba Cloud account to log on to the AnalyticDB for MySQL console. In the upper-left corner, select the region where the cluster resides. In the navigation pane on the left, click Clusters.
On the Clusters page, find a cluster that has the same edition as the source cluster. In the Actions column of the cluster, choose More > Restore Cluster in Same Region.
If no such cluster exists, you must create one first. For more information, see Create a cluster.
Set parameters such as Source Cluster for Cloning, Source Type for Cloning, Source Backup Set for Cloning, and Point in Time. The following table describes the parameters.
Parameter
Description
Billing Method
Select a billing method for the new cluster.
Cross-account Clone
Specifies whether to clone the cluster across Alibaba Cloud accounts. Select Yes.
Cross-account UID
The Alibaba Cloud account that owns the source cluster.
Cross-account Role
The name of the RAM role created in Step 1.
Cross-account Instance ID
The ID of the source cluster.
Cross-account Backup Set ID
The ID of the backup set. You do not need to select an ID.
Source Cluster For Cloning
The ID of the source cluster to be cloned. You do not need to select an ID.
NoteThis parameter has no actual meaning for cross-account cloning and can be ignored.
Source Type For Cloning
Two source types are supported:
Backup Set: Clones data from the target backup set to the new cluster.
Point In Time: Clones data at the target Point In Time to the new cluster.
NoteThis parameter has no actual meaning for cross-account cloning and can be ignored.
Source Backup Set For Cloning
Select the target backup set from the drop-down list.
NoteThis parameter is available only when Source Type For Cloning is set to Backup Set. This parameter has no actual meaning for cross-account cloning and can be ignored.
The start time of each backup set is displayed. You can use this time to determine if it is the backup set you want to restore.
Point In Time
Select a point in time.
NoteThis parameter is available only when Source Type For Cloning is set to Point In Time. This parameter has no actual meaning for cross-account cloning and can be ignored.
You can select a point in time within the last seven days, up to five minutes before the current time.
Edition
Select the cluster edition.
Region
Zone
Select the region and zone for the new cluster.
NoteWhen you clone a cluster within the same region, the new cluster must be in the same region as the source cluster, but they can be in different zones.
For example, if the source cluster is in the China (Hangzhou) region, the Region for the new cluster is fixed to China (Hangzhou) and does not need to be selected.
Network Type
This is fixed to VPC and does not need to be selected.
VPC
vSwitch
Select the VPC and vSwitch for the new cluster.
Automatically Enable PVL Service
PrivateLink establishes secure and stable private connections between a Virtual Private Cloud (VPC) and Alibaba Cloud services. This avoids potential security risks from accessing services over the public network. You must enable this service to create a cluster. Each Alibaba Cloud account needs to enable it only once. The service is free.
NoteIf the purchase page does not prompt you to enable the PVL service, it is already enabled and you do not need to select it.
Disk Encryption
After disk encryption is enabled, the system encrypts the entire data disk based on Elastic Block Storage. This protects your data security because even if a data backup is leaked, it cannot be decrypted.
Select a cluster Edition, configure cluster parameters, and then click Buy Now in the lower-right corner.
Based on the Product Type of the source cluster, follow the instructions in the console to complete the purchase.
After the payment is successful, wait about 20 minutes. You can then view the new cluster in the Cluster List.
(Optional) After you clone the cluster, if you created a temporary cluster to initiate the clone operation and no longer need it, release the cluster promptly. For more information, see Delete or unsubscribe from a cluster.
What to do next
After the cloned cluster is created, you can log on to the new cluster to verify the data. After you confirm that the data is correct, you can use the new cluster for business tests and other operations. For more information about how to log on to a cluster, see Connect to a cluster.
