Export the MariaDB schema and data, resolve incompatibilities, then import everything into MySQL with minimal downtime.
Teams move to MySQL for managed services, enterprise support, or feature parity with existing infrastructure.
Match server versions, backup both databases, verify storage space, and ensure you have SUPER privileges on both hosts.
Use mysqldump
with --routines --events --triggers --single-transaction --skip-lock-tables
to capture a consistent snapshot without downtime.
Sequences, virtual columns using non-deterministic functions, and storage engines like Aria
are unsupported. Replace or remove them before import.
Create a sed/awk script or Python script that comments out CREATE SEQUENCE
and converts JSON
default values to MySQL-compatible syntax.
Run mysql --init-command="SET sql_mode=''" -u root -p targetdb < dump.sql
to avoid strict mode errors during load.
Compare row counts with SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema='myshop';
on both servers. Spot-check financial totals and created_at timestamps.
Switch the ORM or connection pool URL to the new MySQL host, deploy, and monitor error logs for mismatched SQL syntax.
Run the import on a replica, enable binary logging, and use --master-data
in mysqldump
to set up replication for a seamless cut-over.
No. You can use Percona XtraBackup or logical replication, but mysqldump is simplest for small-to-medium datasets.
Yes. Dump with --master-data
, import into MySQL, and configure replication so MySQL follows the MariaDB binlog until switchover.
Time depends on data size. Rough estimate: 2–4 minutes per GB over local network with mysqldump and fast disks.