Moving a database.
WHAT TO ESTABLISH FIRST
Size, and how long a dump and restore takes.
WHY
It determines whether downtime is acceptable.
WHAT THE SIMPLE APPROACH IS
Stop writes, dump, transfer, restore, repoint, start.
WHEN THAT SUFFICES
Small databases and tolerable downtime.
WHAT THE LOW-DOWNTIME APPROACH IS
Set up the new server as a replica of the old Let it catch up Stop writes briefly Confirm no lag Promote it and repoint the application
WHY THAT IS PREFERABLE AT SCALE
Downtime becomes seconds rather than hours.
WHAT TO PREPARE
Matching versions, or a supported upgrade path Matching character sets and collations Accounts and privileges, which dumps frequently omit Routines, triggers and events
WHY ACCOUNTS ARE FORGOTTEN
They live outside the database being dumped.
WHAT TO CHECK BEFORE CUTOVER
That the application can reach the new server That row counts match That a sample of records is identical
HOW TO TEST WITHOUT COMMITTING
Point a copy of the application at it.
WHAT TO KEEP
The old server, until you are certain.
WHAT TO WATCH AFTER
Errors, and slow queries that behaved differently before.