This topic describes how to clone a tenant. By cloning a tenant, you can create a new tenant based on a specified tenant. The number of units and the distribution of units across OBServer nodes in the cloned new tenant are consistent with those of the source tenant.
Note
Starting from OceanBase Database V4.3.x, we recommend that you do not use the primary tenant cloning feature. Starting from OceanBase V4.4.2 BP2, if you attempt to clone the primary tenant, the system will directly report an error and the operation cannot be completed. If you have used the primary tenant cloning feature in a production environment, please contact the OceanBase Technical Support Team promptly for risk assessment and migration guidance to avoid impacting your business due to subsequent version upgrades.
The standby tenant cloning feature is an experimental feature. Before using it, please ensure you understand its usage boundaries and associated risks. The primary application scenario for standby tenant cloning is standby database drills.
You can clone a tenant by using one of the following two methods:
Clone a tenant on the Tenant List page.
Clone a tenant on the Overview page of the specified tenant.
Prerequisites
Ensure the current OCP user has the following permissions:
- Cluster Maintenance resource permission.
- Permission to access the Overview menu for tenants.
The source tenant has been configured for log archiving by referring to Create a tenant-level backup strategy.
Considerations
- The status of the source tenant must be Running or Locked.
- Only the tenant's own configurations, such as units, can be cloned; service names and tags are not supported.
- When cloning a primary tenant, ensure the cluster to which the primary tenant belongs is V4.3.0.0 or later. When cloning a standby tenant, ensure the cluster to which the standby tenant belongs is V4.3.2.0 or later.
Procedure
Log in to OCP.
In the left navigation bar, select Tenant. The system enters the Tenants tab by default.
On the Tenants page, find the target tenant and click Clone in the Actions column.
In the dialog box that appears, configure the relevant information for the new tenant. The details are as follows:
- Tenant Name: The name of the cloned new tenant. It must start with a letter and end with a letter or number, can contain letters, numbers, and underscores, and be 2 to 32 characters long.
- Clone Tenant Parameters: Whether to use the same parameter configuration as the source tenant. This is enabled by default.
- Replica Details: Configure the unit specifications for the cloned new tenant. Since unit specifications affect cloning speed, the system will default to selecting the higher-specification unit from the source tenant, and the unit specifications must be consistent within each zone.
- Allowlist: By default, this is consistent with the source tenant. You can modify it after the tenant cloning is complete by going to the tenant overview page.
- Perform a Minor Compaction before Cloning Tenant: If you want to clone the tenant immediately, you can choose to perform a minor compaction before cloning. Performing a minor compaction will prolong the response time for stopping processes but can significantly shorten the OBServer recovery time.
Click OK.
