Migrate from MySQL to MatrixOne

Review the data migration compatibility cookbook before starting. It defines the ten portability rules and the additional version-specific checks. Do not use mysqldump against a MatrixOne target; use mo-dump for MatrixOne logical backups.

The measured small-sample baseline is MySQL 8.0.44 to MatrixOne v4.2.5. Pin source, target, driver, and exporter versions. MySQL protocol connectivity does not establish identical objects or SQL semantics.

Compatibility inventory

Record tables/keys, integer signedness/ranges, decimal precision, charset/collation, NULL/empty values, timezones, JSON/binary/spatial data, constraints, generated columns, partitions, indexes, views, procedures, triggers, EVENT, and privileges. Check target data types and MySQL compatibility.

v4.2.5 supports SQL/Starlark procedures with different body syntax. DML triggers and MySQL EVENT are unsupported and need explicit business alternatives. Parsing/ignoring ENGINE=InnoDB does not copy InnoDB locking, collation, transactions, or physical storage behavior.

Full-copy choices

Method

Conditions and limits

DBeaver/JDBC

Small trials; size batches by memory, statement bytes, transactions, and retries. Per-table transfer is not cross-table consistency or CDC

mysqldump SQL

Review DDL/session SQL first. --single-transaction applies to supported transactional tables; avoid concurrent DDL and handle nontransactional tables separately

mysqldump -T / CSV + LOAD DATA

-T creates server-side MySQL files and requires FILE/secure_file_priv/writable paths; MO separately needs file access

DataX

Pin and verify reader/writer/driver; create target schema first; batch transfer is not continuous inbound CDC

Neither 5000 rows nor net_buffer_length=10m guarantees direct S3 writes. Benchmark throughput, memory, statement sizes, and transaction duration.

SQL file import

Export during write suspension or at an established consistent point. This data-export template requires reviewed target DDL, isolated targets, actual addresses/identities/database/table, and interactive passwords. Do not enable continue-on-error:

mysqldump --host="$MYSQL_SOURCE_HOST" --port="$MYSQL_SOURCE_PORT"   --user="$MYSQL_SOURCE_USER" --password   --single-transaction --set-gtid-purged=OFF --no-tablespaces   --no-create-info --skip-triggers --compact --skip-add-locks --hex-blob   source_database source_table > reviewed_data.sql
mysql --host="$MO_TARGET_HOST" --port="$MO_TARGET_PORT"   --user="$MO_TARGET_USER" --password --default-character-set=utf8mb4   target_database < reviewed_data.sql

Database/table names are placeholders mapped to one logical object. Retain exit status/errors and inspect committed batches before idempotent retry or compensation. Continuing after an error does not establish completeness. Use SOURCE only in the MySQL CLI; submit complete SQL through JDBC/PyMySQL interfaces.

Both default mysqldump and the shown data-export options imported successfully for the tested fixtures. This does not establish automatic compatibility for arbitrary DDL, routines, triggers, GTID, or all database objects.

Files and encoding

Match column order, delimiter, quoting, escapes, newlines, header, NULL marker, and encoding. \N, empty fields, and empty strings differ. Trial supplementary Unicode, quotes, delimiters, newlines, and binary zero bytes. Verify raw bytes/HEX so UI or driver decoding does not hide corruption. Check server INFILE, client LOCAL, and object-storage access separately.

Incremental and cutover

With ongoing source writes, bind a consistent full-copy point to binlog/GTID and test inserts/updates/deletes, ordering, DDL, duplicates, and recovery. mo_cdc reads from MO; a mysql:// URI is not an inbound MySQL CDC connector. Without a validated connector, use an explicit write-suspension window.

Stop source writes, capture the final position, catch up, handle exceptions, and follow reconciliation/backout before switching clients and jobs. Backout after target writes must retain and reconcile those new changes.

Tutorial and verification scope

See the runnable MySQL migration lab. The probe preserves decimals, NULL/empty strings, Unicode, binary, and microsecond times and catches corrupted values despite matching counts. Manual change replay is not CDC certification. DBeaver/DataX and production live cutover are unverified.