A low-downtime MySQL move uses a consistent copy to seed the destination, replication to catch up ongoing changes, and a short controlled write pause for final cutover. Test the entire sequence before scheduling production.
Last updated: September 26, 2026.
CHANGE REPLICATION SOURCE TO
SOURCE_HOST = 'old-db.internal',
SOURCE_USER = 'replication_user',
SOURCE_AUTO_POSITION = 1,
SOURCE_SSL = 1;
START REPLICA;
SHOW REPLICA STATUS;This MySQL 8 example assumes GTID replication, TLS, a prepared replication account, and a destination seeded from a consistent source snapshot. Never place real credentials in shared scripts.
Prepare compatible servers
Compare MySQL versions, SQL modes, authentication plugins, time zones, collations, storage engines, and enabled features. Ensure the destination can accept every source object and has enough storage and I/O capacity. Test users and grants separately from schema data.
Seed and catch up
- Create and verify a consistent backup or physical snapshot.
- Restore it on the destination and run integrity checks.
- Start replication from the exact recorded position or GTID set.
- Monitor replica errors, lag, and row-count or checksum comparisons.
- Exercise a read-only application connection against the destination.
MySQL’s replication setup guidance describes seeding a new server and starting replication. Fix cross-version restore errors before the cutover window.
Cut over and retain rollback
Pause application writes, wait until replication has no remaining lag, run final checks, and change the application connection through a controlled configuration mechanism. Monitor errors, latency, row changes, jobs, and integrations. Keep the old server read-only and intact for an agreed rollback window; do not accept writes on both independent primaries.
After confidence is established, take a fresh backup from the destination, rotate migration credentials, update monitoring, and document the new source of truth. The existing MySQL backup and restore guide provides the basic logical-backup path when a longer outage is acceptable.
Rebuilding applications around a migrated database?
PHPRunner can generate web applications for MySQL and other databases after the server move is complete. Explore PHPRunner.