PolarDB allows you to create a PolarDB for MySQL cluster by migrating an ApsaraDB RDS for MySQL instance. The created PolarDB cluster uses the accounts, databases, IP address whitelist, and required parameters of the source ApsaraDB RDS for MySQL instance.
Benefits
- The endpoint of the source database are retained. You can switch to PolarDB without changing the connection settings of your applications.
- You can complete data migration in the PolarDB console without. No data migration tool such as data transmission service (DTS) is required.
- The data migration feature is free of charge.
- No data loss occurs during the migration.
- Incremental data migration is supported. This allows you to migrate data with a service downtime of less than 10 minutes.
- Hot migration is supported. A transient connection error occurs only once during the data migration from ApsaraDB RDS for MySQL to PolarDB.
- Migration rollbacks are supported. If a migration fails, the migration can be rolled back within 10 minutes.
Prerequisites
- The source RDS instance uses ApsaraDB RDS for MySQL 5.6 or 5.7 High-availability Edition. The storage type is the local SSD.
-
- For ApsaraDB RDS for MySQL 5.6, the minor version of the kernel for the RDS instance is 20190130 or later.
- For ApsaraDB RDS for MySQL 5.7, the minor version of the kernel for the RDS instance is 20200331 or later.
Note You can run theshow variables like '%rds_release_date%'
command to view the minor version of the kernel for the RDS instance. For more information about how to upgrade the minor version of the kernel, see Update the minor engine version of an ApsaraDB RDS for MySQL instance. - Transparent data encryption (TDE) and secure sockets layer (SSL) are disabled on the source RDS instance.
- The source RDS instance uses InnoDB as the table storage engine.
- If the RDS instance is running in the proxy mode (safe mode), a privileged account
is created. Otherwise, the instance is switched to the high-performance mode. For
more information, see Create a privileged account and [Important] RDS network link upgrade.
Switch with endpoints
When you perform data migration from ApsaraDB RDS for MySQL to PolarDB, you can select Switch with Endpoints (Connection Changes Not Required). Then, the system automatically interchanges the endpoints between the RDS instance and the PolarDB cluster. In this case, you do not need to modify the configurations of your applications to connect to the PolarDB cluster. The following figure shows the rules for endpoint interchanges between the RDS instance and the PolarDB cluster.

To switch with endpoints, take note of the following limits:
- Only the endpoints of the RDS instance and the PolarDB cluster are interchanged. Other configurations are not interchanged, such as the configurations of the vSwitches and virtual IP addresses.
- Endpoints can be interchanged only if both the source RDS instance and the destination PolarDB cluster have endpoints. By default, only the primary endpoints in the internal network can be interchanged.
- To switch to other endpoints, create these endpoints before the switchover. For more information about how to create endpoints for the PolarDB cluster, see Create a custom cluster endpoint. For more information about how to create endpoints for the RDS instance, see Configure endpoints for an RDS instance.
- The port numbers are not interchanged between the RDS instance and the PolarDB cluster. Therefore, make sure that the port number of the RDS instance is the same as that of the PolarDB cluster. The default port number used by RDS and PolarDB is 3306. If the port numbers are different, change one of the port numbers. For more information about how to change the port number, see View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for MySQL instance and Modify or delete an endpoint.
- After the endpoints are interchanged, issues may occur due to the expiration of the Domain Name System (DNS) cache data. The databases in the PolarDB cluster may fail to be connected or support only read operations. We recommend that you refresh the DNS cache data of your server to fix this issue.
- If you want to use Data Management (DMS) to log on to the PolarDB database after the endpoints are interchanged, you must use the latest version of DMS and the cluster ID to log on to the database. You cannot log on to the database by using the endpoint.
Limits
- Cross-region data migration is not supported.
- You cannot set the parameters of the source RDS instance during data migration.
Pricing
You are not charged for data migration from the source RDS instance to the PolarDB cluster. You are charged only for the purchased PolarDB cluster. For more information, see Billable items.
Procedure
Step | Description |
---|---|
1. Migrate data from the source RDS instance | In this step, a PolarDB cluster is created. The cluster stores the same data as the source RDS instance. Then, incremental data is synchronized from the source RDS instance to the PolarDB cluster in real time. |
2. Switch over services |
Note If data errors occur after the switchover is completed, you can roll back the migration.
This allows you to restore the database and data to the status before the data migration.
For more information, see Roll back the migration.
|
3. Complete the migration |
|
Step 1: Migrate data from the source RDS instance
In this step, a PolarDB cluster is created. The cluster stores the same data as the source RDS instance. Then, incremental data is synchronized from the source RDS instance to the PolarDB cluster in real time.
Step 2: Switch over services
Step 3: Complete the migration
Roll back the migration (optional)
If data errors occur before the migration is complete, you can roll back the migration. This allows you to restore the database and data to the status before the data migration. After the rollback, the read/write status of the source RDS instance is changed to Read and Write, and the read/write status of the PolarDB cluster is changed to Read Only. The system synchronizes data from the RDS instance to the PolarDB cluster.
FAQ
- What are the differences among create a PolarDB for MySQL cluster fron an Apsara RDS for MySQL instance, Create a PolarDB for MySQL cluster by using the Clone from RDS method, and Migrate data from an ApsaraDB RDS for MySQL instance to a PolarDB for MySQL cluster?
The following table describes the differences:
Item Create a PolarDB for MySQL cluster fron an Apsara RDS for MySQL instance Create a PolarDB for MySQL cluster by using the Clone from RDS method Migrate data from an ApsaraDB RDS for MySQL instance to a PolarDB for MySQL cluster Requires DTS × × √ Supports incremental data migration or synchronization √ × √ Affects operations on the source RDS instance × × × Uses different MySQL versions for the source and destination databases × × √ Note √ in the table indicates supported or required, and × indicates not supported or not required. - Do the node specifications of PolarDB for MySQL need to be the same as that of the source ApsaraDB RDS for MySQL instance?
You can select the specifications of PolarDB for MySQL based on your business requirements. We recommend that you select the specifications that are not lower than those of the source RDS instance. All nodes in the PolarDB Cluster Edition cluster are dedicated nodes. The dedicated nodes provide stable and reliable performance. For more information, see Billable items.
- Do I need to purchase a PolarDB for MySQL cluster before the upgrade from RDS to PolarDB?
You do not need to purchase a PolarDB for MySQL cluster in advance. You can perform the operations that are described in Step 1: Migrate data from the source RDS instance to purchase and create a PolarDB cluster with the same data as the source RDS instance.
- Is the source RDS instance affected when data is migrated from the RDS instance?
No, the source RDS instance is not affected when data is migrated from the RDS instance.
- What are the impacts of smooth migration on the RDS instance?
The migration does not affect the operations on the source RDS instance. However, data migration causes read operations, which consume query performance on the source RDS instance.
- What are the impacts of smooth migration on my workloads that run on the databases?
A smooth migration ensures no data loss during the migration. The service downtime is less than 10 minutes. During the service downtime, the service is suspended and does not generate incremental data. However, the database is not stopped. You can roll back the migration based on your business requirements.
- What happens if I cancel the migration?
After the migration is canceled, you can modify the parameters of the source RDS instance. The read/write status of the PolarDB cluster is changed to Read and Write, and the data in the cluster is not deleted. If you manually cancel the migration, you can specify whether to disable the binary logging feature for the PolarDB cluster. Binary logging is not disabled if the migration is automatically canceled.
- Do I need to change the endpoint in my applications after the service is switched
over to PolarDB?
When you switch over services, you can select Switch with Endpoints (Connection Changes Not Required). Then, the system automatically interchanges the endpoints between the RDS instance and the PolarDB cluster. In this case, you do not need to modify the configurations of your applications to connect to the PolarDB cluster.
- I select Switch with Endpoints (Connection Changes Not Required) when I switch over services. Why do I need to use the new endpoint to connect to the PolarDB cluster?
Endpoints can be interchanged only if both the source RDS instance and the destination PolarDB cluster have endpoints. By default, only the primary endpoint in the internal network is interchanged. To switch to other endpoints, create these endpoints before the switchover. For more information about how to create endpoints for the PolarDB cluster, see Create a custom cluster endpoint. For more information about how to create endpoints for the RDS instance, see Configure endpoints for an RDS instance.
- If the source RDS instance contains read-only instances, can the endpoints of read-only
instances be switched when Switch with Endpoints (Connection Changes Not Required) is selected?
No, the endpoints of read-only instances cannot be switched. The endpoints of the source RDS read-only instances are not migrated when you upgrade from RDS to PolarDB. Only the endpoints and read/write splitting endpoints of the source RDS primary instance are migrated. You must manually modify the endpoints of the source RDS read-only instances in your applications to the endpoints of the PolarDB cluster.
- After the switchover, why do I fail to connect to PolarDB databases or fail to write data to the databases?
After the endpoints are interchanged, issues may occur due to the expiration of the DNS cache data. The databases in the PolarDB cluster may fail to be connected or support only read operations. We recommend that you refresh the DNS cache to fix this issue.
- Can I perform a compatibility test and evaluate the workloads before the migration
to the PolarDB cluster?
You can first perform the operations described in Create a PolarDB for MySQL cluster by using the Clone from RDS method to clone data to the PolarDB cluster for compatibility tests and workload evaluation. Then perform the operations in this topic to upgrade to PolarDB.
- Why does the Complete Migration not appear in the PolarDB console after I switch over services?
If you complete the Complete Migration step, this button disappears. This avoids repeat operations.
- After the upgrade to PolarDB, do I need to create the same username and password in the PolarDB cluster as those in the source RDS instance ?
No, you do not need to create the same username and password in the PolarDB cluster. The created PolarDB cluster retains the accounts, databases, IP address whitelist, and required parameters of the source ApsaraDB RDS for MySQL instance.
- How do I perform a migration from a source RDS instance that has TDE or SSL enabled
to the PolarDB cluster?
RDS instances with TDE or SSL enabled cannot be upgraded to PolarDB clusters. You can use DTS to migrate data from the source RDS instance to the PolarDB cluster. For more information, see Migrate data from an ApsaraDB RDS for MySQL instance to a PolarDB for MySQL cluster.
- Can I perform a cross-version upgrade when I create a PolarDB cluster by migrating
an ApsaraDB RDS for MySQL instance? For example, can I upgrade from ApsaraDB RDS for
MySQL 5.6 to PolarDB for MySQL 8.0?
No, you cannot perform a cross-version upgrade. To upgrade ApsaraDB RDS for MySQL 5.6 to PolarDB for MySQL8.0, you must use DTS to migrate data. For more information, see Migrate data from an ApsaraDB RDS for MySQL instance to a PolarDB for MySQL cluster.
- If a DTS data synchronization task is started for the source RDS instance before the
upgrade to PolarDB for MySQL, will the task be affected during the upgrade?
No, when you perform operations described in this topic, full data is first cloned from the source RDS instance to the new PolarDB cluster. Then, incremental data is synchronized from the source RDS instance to the PolarDB cluster in real time. The data source of the DTS task is still the source RDS instance. The data migration to the PolarDB cluster does not affect the operations on the source RDS instance.
However, after the migration is completed, if you switch your services to the new PolarDB cluster and the source RDS instance is no longer used, the data source of DTS will not be automatically changed to the new PolarDB cluster. In this case, you must create a new DTS synchronization task and change the data source to the PolarDB cluster.
Related operations
API | Description |
---|---|
CreateDBCluster | Creates a PolarDB cluster.
Note If you create a PolarDB cluster by migrating an ApsaraDB RDS for MySQL instance, set
the CreationOption parameter to MigrationFromRDS.
|
DescribeDBClusterMigration | Queries the migration status of a PolarDB cluster. |
ModifyDBClusterMigration | Switches or rolls back the task that migrates data from ApsaraDB for RDS to PolarDB. |
CloseDBClusterMigration | Cancels or completes the migration for a PolarDB cluster. |