You can clone a source AnalyticDB for MySQL cluster to create a new one. Use this feature to restore data or create a replica of your production environment for pre-launch testing, such as load tests.
Prerequisites
-
To restore a cluster to a specific point in time, ensure that log backup is enabled.
-
To restore a cluster from a backup set, ensure that the source cluster has at least one backup set.
Limitations
-
The following table shows which editions of AnalyticDB for MySQL support the cross-account clone and cross-region clone features.
Feature
Enterprise Edition
Basic Edition
Data Lakehouse Edition
Data Warehouse Edition
Cross-account clone
✔️
✔️
✔️
✔️
Cross-region clone
✔️
✔️
✔️
✖️
-
The cross-region clone feature is not supported in the US (Silicon Valley) or US (Virginia) regions.
-
You cannot change the cluster mode when cloning a Data Warehouse Edition cluster. For example, a cluster in reserved mode can only be cloned to another one 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 only be cloned to other regions within the Chinese mainland. They cannot be cloned to the China (Hong Kong) region or any 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 is not cloned: the whitelist of the source cluster.
Billing
You are charged for the new cluster. For pricing details, see Pricing of Enterprise Edition and Basic Edition clusters, Pricing of Data Lakehouse Edition clusters, and Pricing of Data Warehouse Edition clusters.
Restore duration estimation
The estimation methods and examples provided are for reference only. The actual restore duration is shown in the console.
Backup set restore
Point-in-time restore
Procedure
Same-account clone
-
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 of the desired edition. Find the cluster that you want to clone, and in the Actions column, choose More > Restore Cluster in Same Region.
-
Configure parameters such as the source cluster, restore mode, backup set, and point in time, as described in the following table:
Parameter
Description
Billing Method
Select a billing method for the new cluster.
Clone across Alibaba Cloud accounts
Select No.
Source cluster
The ID of the source cluster. This parameter is automatically populated.
Restore mode
The clone source. Valid values:
-
Backup Set: Clones data from a specified backup set to the new cluster.
-
Backup Time Point: Clones data from a specified Backup Time Point to the new cluster.
Backup set
Select a backup set from the drop-down list.
Note-
The start time of each backup is displayed. Use this time to identify the backup set that you want to restore from.
-
This parameter is available only when Restore mode is set to Backup Set.
Backup Time Point
Select a point in time to restore data from.
Note-
This parameter is available only when Restore mode is set to Backup Time Point.
-
You can select any point in time from 7 days in the past up to 5 minutes before the current time.
Clone across regions
Specifies whether to clone the cluster to a different region. The default value is No.
NoteData Warehouse Edition clusters do not support cross-region clone.
Region
Zone
Select a region and zone for the new cluster.
NoteThe new cluster must be in the same region as the source cluster, but can be in a different zone.
For example, if the source cluster is in the China (Hangzhou) region, the Region for the new cluster is automatically set to China (Hangzhou).
Network Type
This parameter is fixed to VPC and cannot be changed.
Virtual Private Cloud (VPC)
vSwitch
Select a Virtual Private Cloud (VPC) and vSwitch for the new cluster.
Automatically enable PVL service
PrivateLink lets you establish secure and stable private connections between a Virtual Private Cloud (VPC) and Alibaba Cloud services. This avoids potential security risks from public internet access. You must enable this service before you can create a cluster. You need to enable the service only once for each Alibaba Cloud account. The service is free of charge.
NoteIf the purchase page does not prompt you to enable the PrivateLink service, the service is already enabled and you do not need to select this option.
Disk Encryption
After you enable disk encryption, the system encrypts the entire data disk based on block storage. This protects your data because the data cannot be decrypted even if a data backup is leaked.
-
-
Select an Edition for the cluster, configure cluster parameters, and then click Buy Now in the lower-right corner.
-
Complete the purchase based on the Product Type of the source cluster as prompted.
After the payment is successful, the new cluster appears on the Cluster List page in about 20 minutes.
Cross-account clone
-
Using the source Alibaba Cloud account, log on to the RAM console to configure authorization. This allows the destination account to read the source account's AnalyticDB for MySQL resources.
-
Create a RAM role. For more information, see Create a RAM role for a trusted Alibaba Cloud account.
NoteFor the Select Trusted Alibaba Cloud Account parameter, select Other Alibaba Cloud Account and enter the ID of the destination cluster's Alibaba Cloud account. You can log on to the Account Center and view the Account ID on the Overview page.
-
Grant the AliyunADBReadOnlyAccess permission to the RAM role. For more information, see Manage the permissions of 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" }NoteYou must replace testAccountID with the ID of the destination Alibaba Cloud account.
-
-
Use the destination Alibaba Cloud account to log on to the AnalyticDB for MySQL console. In the upper-left corner, select your cluster's region. In the left-side navigation pane, click Clusters.
-
On the Clusters page, click the tab for the product edition, select a target cluster, and then in the Actions column, choose More > Restore Cluster in Same Region.
Ensure the selected target cluster and the source cluster are of the same product edition. Otherwise, you must create a new cluster first. For more information, see Create a cluster.
-
Configure parameters such as the source cluster, restore mode, backup set, and point in time, as described in the following table:
Parameter
Description
Billing Method
Select a billing method for the new cluster.
Clone across Alibaba Cloud accounts
Select Yes.
Cross-account UID
The ID of the Alibaba Cloud account that owns the source cluster.
Cross-account role
The name of the RAM role that you 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 source cluster. This parameter is automatically populated.
NoteThis parameter is not applicable to cross-account cloning and can be ignored.
Restore mode
The clone source. Valid values:
-
Backup Set: Clones data from a specified backup set to the new cluster.
-
Backup Time Point: Clones data from a specified Backup Time Point to the new cluster.
NoteThis parameter is not applicable to cross-account cloning and can be ignored.
Backup set
Select a backup set from the drop-down list.
Note-
This parameter is available only when Restore mode is set to Backup Set. This parameter is not applicable to cross-account cloning and can be ignored.
-
The start time of each backup is displayed. Use this time to identify the backup set that you want to restore from.
Backup Time Point
Select a point in time to restore data from.
Note-
This parameter is available only when Restore mode is set to Backup Time Point. This parameter is not applicable to cross-account cloning and can be ignored.
-
You can select any point in time from 7 days in the past up to 5 minutes before the current time.
Edition
Select the edition of the cluster.
Region
Zone
Select a region and zone for the new cluster.
NoteThe new cluster must be in the same region as the source cluster, but can be in a different zone.
For example, if the source cluster is in the China (Hangzhou) region, the Region for the new cluster is automatically set to China (Hangzhou).
Network Type
This parameter is fixed to VPC and cannot be changed.
Virtual Private Cloud (VPC)
vSwitch
Select a Virtual Private Cloud (VPC) and vSwitch for the new cluster.
Automatically enable PVL service
PrivateLink lets you establish secure and stable private connections between a Virtual Private Cloud (VPC) and Alibaba Cloud services. This avoids potential security risks from public internet access. You must enable this service before you can create a cluster. You need to enable the service only once for each Alibaba Cloud account. The service is free of charge.
NoteIf the purchase page does not prompt you to enable the PrivateLink service, the service is already enabled and you do not need to select this option.
Disk Encryption
After you enable disk encryption, the system encrypts the entire data disk based on block storage. This protects your data because the data cannot be decrypted even if a data backup is leaked.
-
-
Select an Edition for the cluster, configure cluster parameters, and then click Buy Now in the lower-right corner.
-
Complete the purchase based on the Product Type of the source cluster as prompted.
After the payment is successful, the new cluster appears on the Cluster List page in about 20 minutes.
-
(Optional) After you clone the cluster, if you no longer need the cluster that you created in Step 4, release it promptly. For more information, see Delete or release a cluster.
Next steps
After the cloned cluster is created, you can log on to the new cluster to verify its 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.