MySQL to MySQL Migration: Homogeneous Migration and Incremental Sync | NineData
Use this workflow for MySQL version upgrades, data center migration, cloud migration, instance replacement, or other homogeneous MySQL migration projects. NineData can run full migration and incremental synchronization to validate the target database before cutover and reduce the final downtime window.
Overview
NineData data replication supports schema, full data, and incremental data replication between data sources. For supported data sources, it also supports bidirectional replication for geo-distributed active-active architectures.
- Schema replication: Replicates object structures between homogeneous and heterogeneous data sources.
- Full data replication: Uses data sharding and row-level concurrent batch replication to improve throughput. Breakpoint resume helps preserve data accuracy, including for tables without primary keys.
- Incremental data replication: Replicates DML and DDL changes for supported object types. Row-level concurrency and hotspot merge processing help maintain replication throughput.
- Bidirectional real-time data replication (only between MySQL instances): Replicates changes in both directions between nodes so data can stay current across participating nodes.
Use these capabilities for full or incremental data replication, migration, synchronization, data integration, and low-downtime migration workflows.
Before you begin
Add the source and target data sources to NineData. For instructions, see Add Data Source.
Use supported source and target MySQL versions. The source version must be less than or equal to the target version.
Source Data Source Target Data Source MySQL 8.0 MySQL 8.0 MySQL 5.7 MySQL 8.0, 5.7 MySQL 5.6 MySQL 8.0, 5.7, 5.6 MySQL 5.5 MySQL 8.0, 5.7, 5.6, 5.5 MySQL 5.1 MySQL 8.0, 5.7, 5.6, 5.5, 5.1 For incremental replication, enable Binlog on the source data source and set the following parameters:
binlog_format=ROWbinlog_row_image=FULLtipIf the source data source is a replica, enable
log_slave_updatesso NineData can capture complete Binlog events.
Restrictions
- Replication applies only to user databases in the data source. MySQL system databases such as
information_schema,mysql,performance_schema, andsysare not replicated. - The source account must have
SELECTpermission on replication objects for schema and full replication,SHOW VIEWpermission for view replication, andREPLICATION CLIENTandREPLICATION SLAVEpermissions for incremental replication. The target account must have DML and DDL permissions. - Assess source and target performance before synchronization. Run the task during off-peak hours when possible because full initialization consumes read and write resources on both sides.
- If the source contains views, functions, stored procedures, triggers, or events, the synchronized object definitions use the account configured for the target data source as the
DEFINER. - Each replicated table must have a primary key or unique constraint, and column names must be unique. Otherwise, duplicate rows may be replicated.
- If the source contains triggers, NineData synchronizes triggers after incremental synchronization completes.
Procedure
Sign in to the NineData Console.
In the navigation menu, click Replication.
On the Replication page, click Create Replication.
On the Source & Target tab, configure the fields in the table, and then click Next.
Parameter Description Name Enter a meaningful task name for later search and management. Up to 64 characters are supported. Source Select the MySQL data source that contains the objects to replicate. Target Select the MySQL data source that receives the replicated objects. Replication Mode Select Uni-directional. Type Select the content to replicate to the target data source. For a migration with ongoing synchronization, select Schema, Full, and Incremental. The icon opens incremental operation type settings. Clear operation types that you do not want to replicate during incremental synchronization.
If target table already exists (Required when Schema is selected) Choose how NineData handles same-name object conflicts. - Pre-Check Error and Stop Task: Stop the task when the precheck detects a table with the same name.
- Skip and Continue Task: Continue the task after a prompt. During schema replication, skip the same-name table. If data replication is also enabled, append data to the same-name table without overwriting existing data.
- Delete Objects and Rewrite: Continue the task after a prompt. During schema replication, delete the same-name table in the target database and recreate the table structure from the source. If data replication is also enabled, write data after schema replication completes.
- Keep Schema and Clear Data, then Rewrite (Optional when both schema and data replication are selected): Continue the task after a prompt. During schema replication, keep the target table structure, clear data from the same-name table when data replication starts, and then replicate data from the source table again.
On the Objects tab, configure the following parameters, and then click Next.
Parameter Description Replication Objects Select the content to replicate. Select All Objects to replicate all content from the source database, or select Customized Object, choose objects in the Source Object list, and click > to move them to the Target Object list. Blacklist (Optional) Click Add to add a blacklist record. Select the database or object to exclude from replication. Use this option to exclude specific databases or objects when you use Customized Object or Full Instance replication. - Left drop-down list: Select the database to add to the blacklist.
- Right drop-down list: Select objects in the selected database. Multiple objects can be selected. Leave this field empty to add the entire database to the blacklist.
On the Mapping tab, configure target table names, and then click Save and Pre-Check. If the source or target metadata changes during mapping, click Refresh Metadata to refresh source and target metadata.
tipClick Mapping & Filtering to customize target column names. Set Data Filter by using comparison expressions. Only rows that match the filter are replicated to the target. For example, if the filter is
emp_no>=10005, rows whoseemp_novalue is less than10005are not replicated.On the "Pre-check" tab, wait for NineData to complete the precheck. After the precheck passes, click Launch.
On the Launch page, the Launch Successfully message appears and the synchronization task starts. Then:
- Click View Details to view each replication stage.
- Click Back to list to return to the Replication task list.
Result
After the task starts, monitor each replication stage, review task details, and run data comparison before business cutover when consistency validation is required. When incremental delay reaches 0 seconds and validation passes, switch application traffic based on your cutover plan.