×
Community Blog Solution: Manual Logical Migration from a Self-managed MySQL Database to PolarDB-X Standard Edition

Solution: Manual Logical Migration from a Self-managed MySQL Database to PolarDB-X Standard Edition

This article outlines a manual logical migration from self-managed MySQL to PolarDB-X Standard Edition, while strongly recommending DTS for safer, more efficient migration.

By Yan Hua

1. Preface

1.1. Why Choose PolarDB-X Standard Edition?

In today's data-driven business landscape, traditional self-managed MySQL databases face growing challenges: ensuring high availability is increasingly difficult, performance bottlenecks become more pronounced, and the costs and efforts of scaling and maintenance rise sharply. As business expands, many organizations are turning to database solutions that offer greater efficiency, reliability, and scalability. PolarDB-X Standard Edition is designed to meet those needs. Compared with a self-managed MySQL database, PolarDB-X Standard Edition addresses several critical pain points:

• Powered by the self-developed XPaxos algorithm, PolarDB-X provides financial-grade high availability, delivering strong consistency with a recovery point objective (RPO) of 0 and removing the need to build complex primary/secondary replication and failover mechanisms.

• The self-developed Lizard transaction system enhances InnoDB's transaction processing, improving read/write performance while providing a solid foundation for integrated centralized and distributed architectures.

• PolarDB-X is 100% compatible with MySQL, making migration from a self-managed MySQL database smooth and straightforward without requiring changes to existing application logic.

1

1.2. Why Choose Logical Migration?

When users plan to migrate a self-managed MySQL database to PolarDB-X Standard Edition, they may ask why an in-place physical upgrade is not advisable. PolarDB-X Standard Edition is built on MySQL Community Edition, whereas self-managed MySQL environments commonly run either MySQL 5.7 or 8.0.

• MySQL 5.7 to PolarDB-X Standard Edition

  • An in-place upgrade requires first updating MySQL 5.7 to the latest 5.7 minor release and only then upgrading to 8.0, effectively two sequential upgrades.
  • In-place upgrades require downtime. Minor-version updates are relatively quick, but the major jump from 5.7 to 8.0 is time-consuming, resulting in prolonged overall downtime.
  • Even when an in-place upgrade completes, any post-upgrade issues can be remedied only by restoring from a prior physical backup. Such rollback operations typically take hours and will discard any data produced after the upgrade.
  • The MySQL community generally does not recommend in-place upgrades for major version changes.

• MySQL 8.0 to PolarDB-X Standard Edition

  • PolarDB-X integrates centralized and distributed architectures. Its data node (DN) storage extends MySQL's row format with additional GCN and SCN columns, so in-place physical upgrades from MySQL 8.0 are not supported.
  • Even when an in-place upgrade completes, any post-upgrade issues can be remedied only by restoring from a prior physical backup. Such rollback operations typically take hours and will discard any data produced after the upgrade.

Logical migration avoids all of the preceding pitfalls and also standardizes the upgrade process. Therefore, in-place physical upgrades are not supported. Logical migration is the recommended method for migrating a self-managed MySQL database to PolarDB-X Standard Edition.

1.3. Recommended: Use Professional Migration Tools

Although you can perform data migration with basic methods such as dump-and-load or primary/secondary replication, we strongly recommend that you use professional migration tools for these reasons:

• Significantly reduced migration duration: Professional tools use parallel/concurrent transfer to greatly increase synchronization throughput and shorten total migration duration.

• Minimized downtime: They automate critical steps such as suspending writes, validating data, and performing the traffic cutover, which drastically reduces cutover windows and eliminates human operational risks.

• Robust monitoring: Built-in monitoring gives real-time visibility into progress and risks, so you can track the migration process end-to-end.

• Strong data consistency: Features such as resumable transfer, real-time validation, and reverse (backward) synchronization help ensure that data remains consistent across all migration steps.

2. Manual Migration

For various reasons, some users may still need to perform a manual migration. If you understand the risks and limits of manual logical migration, the following simplified procedure can be used as a reference for migrating a self-managed MySQL database to PolarDB-X Standard Edition.

2.1. Prerequisites

• Physical backups are performed. Data is your company's most valuable asset. A failed migration can have catastrophic consequences. No matter how well the process is designed, migrating without reliable backups is highly risky. Keep at least one full physical backup on independent storage and verify its restorability. Perform backups at multiple critical points where feasible, and make sure that they include at minimum: the source database backed up during the cutover downtime (while writes are suspended), and the destination database backed up during the cutover downtime (while writes are suspended).

• Binary logging is enabled for the source database. Manual logical migration depends on MySQL binary logs, so the source database must have binary logging enabled and use the ROW binary log format (binlog_format = ROW).

• Global transaction identifier (GTID) is enabled for the source database. Although MySQL replication can use file/position-based offsets, that approach does not reliably support resumable transfer or robust data validation. Enabling GTID is strongly recommended and required for reliable logical migration.

• Different server_id values are used. Make sure that the source and destination databases have different server_id values, so the logical migration will not fail due to duplicate server identifiers.

2.2. Migration Process

The overall migration process consists of the following steps: full migration → incremental synchronization → downtime backup and validation → reverse synchronization → traffic cutover → post-cutover wrap-up.

• Full migration refers to exporting all data from the source database into SQL files and then importing those files into the destination database.

  • To generate binary logs, the SQL files must be manually modified to ensure that @@SESSION.SQL_LOG_BIN is enabled during the import process.

• Incremental synchronization uses a MySQL replication link, where the self-managed MySQL database acts as the primary (source database) and PolarDB-X Standard Edition acts as the secondary (destination database). The destination database continuously synchronizes real-time writes from the source database.

  • For incremental synchronization to work, binary logging must be enabled for the source MySQL database so that every write operation is recorded as logical log entries.
  • To support resumable replication, both the source and destination databases must have GTID enabled. GTID uniquely identifies each transaction, allowing replication to reliably continue or skip transactions as required.

• For downtime backup and validation, application writes are suspended before traffic cutover. Physical backups are performed on both the source and destination databases, and data consistency between them is verified. Traffic cutover can proceed only after validation succeeds.

  • Source database backup: Use the open source XtraBackup tool to back up the self-managed MySQL database, such as Percona XtraBackup. Details are out of scope for this article.
  • Destination database backup: Use the XtraBackup capability provided by PolarDB-X to back up PolarDB-X DNs. For more information, see PolarDB-X Open Source User Guide – Paxos-based MySQL Triple Replica Backup and Restore.
  • If the business prioritizes data consistency and requires that no data be lost during migration, application writes must be suspended to obtain a validation window.
  • If minimizing downtime is more important and online cutover without write suspension is required, the downtime backup and validation step can be skipped.

• Reverse synchronization sets up a reverse MySQL replication link, in which the source database becomes the secondary and the destination database becomes the primary. The source database then continuously synchronizes real-time writes from the destination database. The purpose of this step is to ensure that the cutover operation is reversible.

• Traffic cutover refers to gradually redirecting both read and write traffic from the source database to the destination database, thereby accomplishing the final objective of the migration.

• After the destination database works in production for a period following cutover and meets expectations, the reverse replication link can be shut down and the source database can be decommissioned. This marks the completion of the manual logical migration from a self-managed MySQL database to PolarDB-X Standard Edition.

2.3. Full Migration

Because MySQL system tables are not always compatible across different MySQL versions, full data migration requires handling non-system tables and account (user/permission) tables separately.

2.3.1. Migrate Non-system Tables

1.  Connect to the source MySQL database and use mysqldump to dump data. Sample code:

nohup /u01/xcluster80/bin/mysqldump -h127.0.0.1 -uadmin -p123456 -P3101 \
--set-gtid-purged=ON --databases d2 d1 > dbs.sql &

Note:

• Because incremental synchronization will follow, it is essential to use the --set-gtid-purged=ON option when you run mysqldump. This ensures that GTIDs are recorded in the dump file.

2.  Modify the dump file.

After the dump file is generated, make modifications to enable binary logging. Sample code:

# Comment out statements that disable binary logging.
sed -i '/SET @@SESSION\.SQL_LOG_BIN/ s/^/-- /' dbs.sql

Note:

• Commenting out SQL_LOG_BIN ensures that the imported full data generates binary logs on PolarDB-X DNs, allowing synchronization to follower nodes. Without this step, the imported data exists only on the leader node, and follower nodes cannot receive it.

• Migration from MySQL 5.7 to 8.0 requires specifying default_collation_for_utf8mb4:

  • In MySQL 5.7, tables created with the utf8mb4 character set but without an explicit collation default to utf8mb4_general_ci. Exported table schemas also do not include a collation (legacy choice prioritizing performance over strict correctness). In MySQL 8.0, the default collation for utf8mb4 has changed to utf8mb4_0900_ai_ci, controlled by the default_collation_for_utf8mb4 parameter. Without adjustment, query results on migrated databases may differ from the original MySQL 5.7 behavior.
  • To maintain consistency, explicitly set the collation by adding the following line in the dump file:
-- Set the default collation for utf8mb4.
sed -i '/SET @@SESSION.SQL_LOG_BIN.*/a\set @@session.default_collation_for_utf8mb4=utf8mb4_general_ci;'  dbs.sql

3.  Import full data.

/u01/xcluster80/bin/mysql -h 127.0.0.1  -uadmin -p123456 -P3201  < dbs.sql

Note:

• After data is imported, on the PolarDB-X leader node, run this command: select * from information_schema.ALISQL_CLUSTER_HEALTH. This ensures no replication delay and no interruption to applications.

2.3.2. Migrate Accounts

You can use the following script to export all user creation statements and permission grants in one step, and then execute them on the destination database.

hostname='127.0.0.1'
port=3306
username='root'
password='your_password'
mysql_exe=/usr/bin/mysql  # Adjust based on the actual installation path.

echo "SELECT CONCAT('SHOW CREATE USER ''',user,'''@''',host, ''';','SHOW GRANTS FOR ''',user,'''@''',host, ''';') FROM mysql.user WHERE user NOT IN ('mysql.sys', 'root', 'mysql.information_schema', 'mysql.session' )" | \
${mysql_exe} --host=$hostname --user=$username --password=$password --port=$port -N | \
${mysql_exe} --host=$hostname --user=$username --password=$password --port=$port -N | \
sed "s/$/;/" > ./create-users.sql
/u01/xcluster80/bin/mysql -h 127.0.0.1  -uadmin -p123456 -P3201  < create-users.sql

2.4. Incremental Synchronization

Incremental synchronization is performed by using standard MySQL replication, with the self-managed MySQL database as the primary and the PolarDB-X leader node as the secondary.

#1. Create a replication user on the primary.
create user rep identified with mysql_native_password by '123456';
grant replication slave on *.* to rep;

#2. Display a list of replica servers registered with the source server.
mysql> show slave hosts;
Empty set, 1 warning (0.00 sec)
#3. Stop the previously created aaa replication link on the secondary.
stop slave for channel 'aaa';
reset slave all for channel 'aaa';

#4. Configure the aaa replication link. Set master_host and master_port to the host and port of the primary. 
# Set master_user to the replication user created in Step 1.
change master to master_host = '127.0.0.1', master_port = 13050, \
master_user = 'rep', master_password = '123456', \
master_auto_position=1 \
for channel 'aaa';

#5. Check the channel status. Initially, both Slave_IO_Running and Slave_SQL_Running are No.
show slave status for channel 'aaa'\G

#6. Exclude system databases and tables from replication, such as heartbeat tables.  
#  Add the following parameters to the CNF file of the secondary and restart the instance for them to take effect:
replicate_ignore_db=aaa:mysql
replicate_ignore_db=aaa:sys
replicate_ignore_db=aaa:__recycle_bin__
replicate_ignore_db=aaa:information_schema
replicate_ignore_db=aaa:performance_schema

#7. Start the aaa replication link on the leader node of the secondary.
start slave for channel 'aaa';

#8. Check the channel status. Both Slave_IO_Running and Slave_SQL_Running become Yes.
show slave status for channel 'aaa'\G
#9. Confirm the replication server on the primary.
mysql>  show slave hosts;
+-----------+------+-------+-----------+--------------------------------------+
| Server_id | Host | Port  | Master_id | Slave_UUID                           |
+-----------+------+-------+-----------+--------------------------------------+
|        10 |      | 13060 |         2 | 26663b57-91e6-11f0-8700-b8599f3009a8 |
+-----------+------+-------+-----------+--------------------------------------+
1 row in set (0.00 sec)

Note:

• During incremental synchronization, the PolarDB-X DN cluster cannot switch the leader node. If a leader switch occurs, the replication link must be reconfigured on the new leader node.

• During incremental synchronization, you can monitor replication in real time on the destination database by running the show slave status for channel 'aaa' command to check for delay or interruption, ensuring no impact on applications.

2.5. Downtime Backup and Validation

If the business prioritizes data consistency and requires that no data be lost during migration, application writes must be suspended to obtain a validation window. If minimizing downtime is more important and online cutover without write suspension is required, the downtime backup and validation step can be skipped.

2.5.1. Precheck

• Confirm that the incremental replication latency is less than 60 seconds and applications are not interrupted.

  • On the destination database, run this command: show slave status for channel 'aaa'. Ensure that applications are not interrupted and the replication latency seen by the applications is less than 60 seconds.

• Ensure that the destination PolarDB-X cluster itself has a synchronization latency less than 60 seconds and no interruptions.

  • On the leader node, run this command: select * from information_schema.ALISQL_CLUSTER_HEALTH. Confirm that the cluster is stable and applications are not interrupted.

2.5.2. Downtime Writes

• Suspend application writes.

• Set the source MySQL database to the read-only mode.

  • SET GLOBAL read_only = ON;
  • SET GLOBAL super_read_only = ON;

• Wait for the application latency in the destination database to reach zero.

  • On the destination database, run this command: show slave status for channel 'aaa'. Ensure that applications are not interrupted and the replication latency seen by the applications drops to zero.

2.5.3. Backup

• Perform a physical backup of the source MySQL database.

• Use the XtraBackup tool provided by PolarDB-X to perform a physical backup of the destination database.

• The backup process does not block subsequent data validation and can be run asynchronously in the background.

2.5.4. Validation

• Verify data consistency between the source and destination databases.

  • On the source database, execute the FLUSH LOGS; statement and check the mysql.gtid_executed table.
  • On the destination database, execute the FLUSH LOGS; statement and verify that the mysql.gtid_executed table contains all GTIDs executed on the source MySQL database.

• Validate the actual data.

  • Method 1: Use CHECKSUM TABLE

    • On the source database, generate checksum statements for all tables, such as CHECKSUM TABLE d1.t1;.
    • SELECT CONCAT('CHECKSUM TABLE ', table_schema, '.', table_name,'; ') AS checksum_statements FROM information_schema.TABLES where TABLE_SCHEMA not in ('information_schema', 'performance_schema', 'mysql', 'sys');
    • Execute the checksum statements on both the source and destination databases, and then compare the results to ensure that they are identical.
  • Method 2: Use Percona's pt-table-checksum tool

• Remove the replication link from the destination database.

  • stop slave for channel 'aaa';
  • reset slave all for channel 'aaa';

2.6. Reverse Synchronization

Database O&M actions must follow three guiding principles: observability, canary release, and rollback capability. Manual migration cannot fully ensure comprehensive observability or a true phased release, but it can preserve rollback capability as much as possible. To enable rollback, use MySQL replication to establish a reverse synchronization link, in which PolarDB-X Standard Edition serves as the primary and the self-managed MySQL database acts as the secondary. After cutover, application write traffic goes to PolarDB-X, while the writes are simultaneously replicated back to the legacy self-managed MySQL database. The following code provides an example:

#1. Check the latest binary logs.
mysql> show consensus logs;
+---------------+-----------+-----------------+
| Log_name      | File_size | Start_log_index |
+---------------+-----------+-----------------+
| binlog.000001 |     15777 |               1 |
| binlog.000002 |      7611 |              44 |
+---------------+-----------+-----------------+
2 rows in set (0.00 sec)

#2. Check the End_log_pos of the last entry in the latest binary logs.
mysql> show binlog events in 'binlog.000002';
+---------------+------+--------------------------+-----------+-------------+--------------------------------------------------------------+
| Log_name      | Pos  | Event_type               | Server_id | End_log_pos | Info                                                         |
+---------------+------+--------------------------+-----------+-------------+--------------------------------------------------------------+
| binlog.000002 |    4 | Format_desc              |        10 |         190 | Server ver: 8.0.32-X-Cluster-8.4.20-20241014, Binlog ver: 4  |
| binlog.000002 |  190 | Previous_consensus_index |        10 |         221 | ##PREV_CONSENSUS_INDEX: 44'                                  |
| binlog.000002 |  221 | Previous_gtids           |        10 |         332 | 37a1bb4b-91f9-11f0-b12d-b8599f3009a8:1-30,
902b4fe0-92a4-11f0-92ea-b8599f3009a8:1-11                                                                                                  |

.......

| binlog.000002 | 7580 | Xid                      |         3 |        7611 | COMMIT /* xid=237 */                                         |
+---------------+------+--------------------------+-----------+-------------+--------------------------------------------------------------+
78 rows in set (0.00 sec)
#3. Stop the previously created bbb replication link on the secondary.
stop slave for channel 'bbb';
reset slave all for channel 'bbb';

#4. Configure the bbb replication link. Set master_host and master_port to the host and port of the primary. 
# The values of master_log_file and master_log_pos are obtained from the primary in the previous steps.
change master to master_host = '127.0.0.1', master_port = 13050, \
master_user = 'rep', master_password = '123456', \
master_log_file='binlog.000002' \
master_log_pos=7611 \
for channel 'bbb';

#5. Check the channel status. Initially, both Slave_IO_Running and Slave_SQL_Running are No.
show slave status for channel 'bbb'\G

#6. Exclude system databases and tables from replication, such as heartbeat tables.  
#  Add the following parameters to the CNF file of the secondary and restart the instance for them to take effect:
#  MySQL 5.7 does not support channel-specific filters. Global filters are used.
replicate_ignore_db=mysql
replicate_ignore_db=sys
replicate_ignore_db=__recycle_bin__
replicate_ignore_db=information_schema
replicate_ignore_db=performance_schema

#7. Start the bbb replication link on the leader node of the secondary.
start slave for channel 'bbb';

#8. Check the channel status. Both Slave_IO_Running and Slave_SQL_Running become Yes.
show slave status for channel 'bbb'\G
#9. Confirm the replication server on the primary.
mysql>  show slave hosts;
+-----------+------+-------+-----------+--------------------------------------+
| Server_id | Host | Port  | Master_id | Slave_UUID                           |
+-----------+------+-------+-----------+--------------------------------------+
|        1  |      | 13010 |         2 | 902b4fe0-92a4-11f0-92ea-b8599f3009a8 |
+-----------+------+-------+-----------+--------------------------------------+
1 row in set (0.00 sec)

Note: The reverse synchronization procedure is largely the same as the incremental synchronization procedure, but with the following key differences and considerations:

• For reverse synchronization, do not specify master_auto_position in the CHANGE MASTER statement. Instead, explicitly specify master_log_file and master_log_pos.

  • The values of master_log_file and master_log_pos must be taken from the current binary log file name and the latest position in PolarDB-X.
  • This ensures that only incremental logs starting from the specified binary log and position are synchronized, and that historical data in PolarDB-X is not replicated.

• System databases still need to be excluded from replication. However, MySQL 5.7 does not support channel-specific replication filters, so global filters are used.

• During reverse synchronization to a MySQL 5.7 replica, the PolarDB-X primary cannot use MySQL 8.0 features, such as the utf8mb4_0900_ai_ci collation. Otherwise, replication will fail when those changes are applied to the MySQL 5.7 replica.

2.7. Traffic Cutover

After the preceding steps are complete, proceed with application traffic cutover:

• Update the applications' database connections to use the PolarDB-X Java Database Connectivity (JDBC) driver and point to the PolarDB-X DN cluster.

• Bring the applications back online and run smoke tests followed by comprehensive functional tests.

• Monitor PolarDB-X DN metrics and the applications closely.

2.8. Post-cutover Wrap-up

• Wait for the source and destination physical backups to finish. Retain these backups securely as rollback points.

• If PolarDB-X operates normally for a sustained observation period and meets expectations, consider the cutover successful.

• Decommission the self-managed MySQL database.

2.9. Exception Rollback

If an issue occurs during or after the cutover, you can roll back as needed:

• If an issue occurs before final wrap-up (for example, data validation fails or the destination database is unavailable):

  • Investigate and resolve the root cause.
  • Abort the cutover, re-enable writes on the source database, and restore application traffic to the source database.

• If an issue occurs after wrap-up (for example, the destination database becomes frequently unstable or unavailable):

  • Troubleshoot and attempt to resolve the issue while continuing to use the destination database.
  • If the issue persists, stop the applications and cut back to the self-managed MySQL database (downtime cutback).

• If you need to roll the applications back to a point in time around the cutover:

  • To restore historical source data, restore the source database from the retained source backup set.
  • To reset the destination database to its initial post-migration state, restore it from the retained destination backup set.

3. FAQ

3.1. Parameter Templates

When you migrate workloads from a legacy self-managed MySQL database to a PolarDB-X DN, the parameter template must be derived from the original MySQL configurations, with DN-specific parameters applied on top of it. This approach ensures behavioral consistency before and after migration and avoids correctness or performance issues caused by parameters such as sql_mode and buffer_size. Custom parameter configurations used in the self-managed MySQL database cannot be removed. PolarDB-X DNs have strong dependencies on the following parameters:

cluster_id: the unique cluster ID. Each DN cluster must use a different value.

  • Even for standalone deployments, we recommend that you use this parameter to support future scaling to a high-availability cluster.

cluster_info: the topology of the cluster. The format is: ip1:port1;ip2:port2;ip3:port3@idx.

  • The idx value differs across machines and specifies the ordinal position of the corresponding ip:port.
  • port specifies the internal communication port used by DNs. Each node must use a unique port, and network connectivity must be properly configured.

server_id: the unique node ID within the cluster. The value must be different for each DN.

port: Each DN must listen on a different port, and network access to the port must be ensured.

sync_binlog=1: Together with innodb_flush_log_at_trx_commit=1, this setting ensures an RPO of 0 for a single DN. Default value: 1.

innodb_flush_log_at_trx_commit=1: Together with sync_binlog=1, this setting ensures an RPO of 0 for a single DN. Default value: 1.

log_bin: XPaxos-based log replication has a hard dependency on enabled binary logging. High-availability clusters also rely on this setting. Default value: ON.

gtid_mode: DN relies on GTID to ensure an RPO of 0 during log application and crash recovery. Default value: ON.

enforce_gtid_consistency: DN relies on GTID to ensure an RPO of 0 during log application and crash recovery. Default value: ON.

implicit_primary_key: automatically adds an implicit primary key to tables that do not define one, preventing overall performance degradation on destination tables. Default value: OFF.

sql_require_primary_key: forces explicit primary key definitions during table creation. Although an implicit primary key is added when implicit_primary_key is set to ON, it is still inferior to a primary key designed based on business logic. Recommended configurations:

  • During migration, set sql_require_primary_key to OFF to avoid migration failures on tables without primary keys.
  • After migration, set sql_require_primary_key to ON to explicitly block tables without primary keys and require the applications to define optimal primary keys based on business logic.
  • Note: Do not use the community parameter sql_generate_invisible_primary_key. This parameter does not support primary/secondary replication and also overrides the checks enforced by sql_require_primary_key.

3.2. Changes in default_collation_for_utf8mb4

In MySQL 5.7, when a table is created with the utf8mb4 character set but without an explicit collation, the default collation is utf8mb4_general_ci. The exported table schema includes only the character set, without an explicit collation. In MySQL 8.0, however, when a table is created with utf8mb4 and no collation is specified, the default collation becomes utf8mb4_0900_ai_ci.

Consequently, if a table schema exported from MySQL 5.7 is run on MySQL 8.0, the resulting table will use utf8mb4_0900_ai_ci. This can cause query results to differ from those on MySQL 5.7, leading to inconsistencies in application behavior.

Scenario utf8mb4_0900_ai_ci utf8mb4_general_ci
Performance Performance difference negligible on modern hardware and optimized algorithm Simple algorithm, which may be slightly faster in extreme scenarios
Compatibility Default recommendation for MySQL 8.0 and later Default option for earlier MySQL versions
Language support More languages and special characters Mainly for English and basic Latin characters
Unicode standard Based on Unicode 9.0 Based on older simplified rules
Special Chinese characters More comprehensive support May not support or handle accurately
Mixed emojis Correct ordering Ordering may be inaccurate

To avoid the community pitfall regarding default_collation_for_utf8mb4, PolarDB-X recommends the following approach:

1.  During full migration, specify the following parameter in the full SQL dump file:

set @@session.default_collation_for_utf8mb4=utf8mb4_general_ci;

2.  During incremental migration, the system can automatically handle the changes in default_collation_for_utf8mb4 between MySQL 5.7 and PolarDB-X DN 8.0 to ensure compatibility.

3.  After migration, to prevent the accidental misuse of default_collation_for_utf8mb4, specify the following parameters on PolarDB-X DNs:

# Disable reliance on the default collation for utf8mb4, that is, disallow specifying utf8mb4 without an explicit collation.
disable_default_collation_for_utf8mb4=ON

# Force the SHOW CREATE TABLE output to include an implicit collation for utf8mb4.
force_print_utf8mb4_implicit_collation=ON

4. Summary

Migrating a self-managed MySQL 5.7 database to PolarDB-X Standard Edition is a complex technical task that requires a thorough understanding of the differences between the two database systems and the key points in the migration process. Although this article provides a detailed guide for manual migration, we still strongly recommend that you use professional migration tools such as Data Transmission Service (DTS) to reduce risks and improve migration efficiency.

During migration, the process must follow the "three guiding principles" (observability, canary release, and rollback capability) to ensure a secure and controllable process. After migration, comprehensive business verification is essential to confirm that all features operate correctly on the new database platform. Ensuring this is the ultimate goal of migration efforts.

0 0 0
Share on

ApsaraDB

573 posts | 179 followers

You may also like

Comments