Quick revision
The short answer
I would first make the system safe to work on, with a tested physical backup and binary logging, then take an inventory of tables, MyISAM-specific features and the application's assumptions. The move itself goes through replicas: build a replica, step it through 5.7 and 8.0 to 8.4, convert the tables to InnoDB on a replica first, and test the application against it, fixing what changes when transactions, deadlocks and different full-text behaviour appear. Cutover is a short write freeze and a switch, with the old system kept read-only for a set rollback period.
What to remember
In this answer, we planned the move from a 10-year-old MySQL 5.6 system with 400 MyISAM tables. We made it safe first with a tested physical backup, binary logging and a replica, then inventoried tables, full-text indexes and application assumptions. We stepped through 5.7, 8.0 and 8.4 on a chain of replicas, converting to InnoDB on the first replica, and fixed the application for real transactions, possible deadlocks and different full-text behaviour. The cutover is a short write freeze, with the old system kept read-only as a rollback option for a set period.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would first make the system safe to work on, with a tested physical backup and binary logging, then take an inventory of tables, MyISAM-specific features and the application's assumptions. The move itself goes through replicas: build a replica, step it through 5.7 and 8.0 to 8.4, convert the tables to InnoDB on a replica first, and test the application against it, fixing what changes when transactions, deadlocks and different full-text behaviour appear. Cutover is a short write freeze and a switch, with the old system kept read-only for a set rollback period.
Why this question is asked
An inherited system like this is fragile in every direction: the version has been out of support for years, the engine corrupts tables whenever the server stops badly, and with no replicas, a single disk failure loses everything since the last dump. The temptation is to fix it all in one weekend. Interviewers ask this scenario to see whether we sequence the work so that each step reduces risk before the next one adds any. In this answer, we will start with backups and replication, build the inventory, plan the upgrade and engine conversion through replicas, deal with the application changes, and finish with the cutover and rollback.
1Step One: Make It Safe Before Changing Anything
Nightly corruption repairs and no replicas mean the current state is already risky, so the first work protects what exists. We take a physical backup with Percona XtraBackup, which copies InnoDB files while the server runs and takes a short lock to copy MyISAM tables consistently, and we restore it on another machine to prove it works. We enable binary logging if it is off (log_bin and a server_id, which needs a restart in 5.6), so that changes after the backup can be replayed and so that replicas become possible.
With a backup and a binlog, we build the first replica on the same 5.6 version. That alone removes the single point of failure and gives us a place to run heavy analysis without touching the primary.
2Step Two: Take an Inventory
Next we learn exactly what we are moving. For every table we collect its size, row count, engine, row format and index types, and we look for the MyISAM features that behave differently in InnoDB.
On the application side, we capture a few days of real queries, for example with the slow log at long_query_time=0 on the replica, and search the code for patterns that rely on MyISAM: COUNT(*) on whole tables shown on screens, LOCK TABLES used to make multi-statement changes consistent, MATCH ... AGAINST queries, transactions that were silently ignored, and composite keys with AUTO_INCREMENT on their second column, which MyISAM supports per group and InnoDB does not.
3Step Three: Upgrade and Convert Through Replicas
MySQL supports upgrades one release series at a time, so a 5.6 server cannot jump to 8.4. Rather than upgrading the primary in place, we build a chain of replicas: a 5.7 replica of the 5.6 primary, an 8.0 replica of that, and an 8.4 replica of the 8.0 server, using the upgrade checker in MySQL Shell at each step. The tables are converted to InnoDB on the first replica in the chain with ALTER TABLE ... ENGINE=InnoDB; replication still works, because the replica applies the primary's changes to its own InnoDB tables.
- Backup and binlog on 5.6restore tested
- Inventory tables and queriesMyISAM-specific behaviour
- 5.7 replica, convert to InnoDBALTER TABLE ... ENGINE=InnoDB
- 8.0 replica, then 8.4 replicaupgrade checker at each step
- Test the application on 8.4replayed queries, full test suite
- Results and performance acceptable?YesPlan cutoverNoFix and repeat the test
- Cutover with a short write freezeold primary kept read-only
7 steps in order. Play them, or step through them one at a time.
The order matters. Converting first means the 8.0 and 8.4 steps only ever see InnoDB tables, and the conversion happens on a copy where it cannot hurt production. We also check disk space: InnoDB tables are often 1.5 to 3 times larger than the same MyISAM data.
4Step Four: Fix What Changes in the Application
The application has been running on an engine without transactions for ten years, so some code will behave differently once InnoDB actually honours them. A method that does several writes and then rolls back on error used to keep the earlier writes; now they are undone, which is correct but may surprise code or reports that relied on it. Row-level locking means writers no longer queue on whole tables, but deadlocks become possible, so the data access layer needs a retry for deadlock errors. LOCK TABLES blocks still work, but under InnoDB they interact with transactions, so we replace them with proper transactions.
Full-text search needs particular care. InnoDB's FULLTEXT uses a different default stopword list, a different minimum token size (innodb_ft_min_token_size is 3, MyISAM's ft_min_word_len is 4) and different relevance ranking, so the same MATCH ... AGAINST returns different results and order. We compare results for the most common searches and tune settings or accept the change with the product owner. Screens that show total counts on huge tables may need a cached count.
| Area | Under MyISAM | Under InnoDB |
|---|---|---|
| ROLLBACK | ignored, writes stay | writes undone |
| Concurrent writes | table lock, they queue | row locks, deadlocks possible |
| COUNT(*) on a whole table | instant | index scan |
| Full-text search | MyISAM stopwords and ranking | different stopwords, token size, ranking |
| Crash | tables may need REPAIR | automatic recovery |
AUTO_INCREMENT per group | supported | not supported |
5Step Five: Cutover and Rollback
After the application has run its full test suite and a replay of production queries against the 8.4 InnoDB replica, we rehearse the cutover in a staging copy and then run it for real: set the 5.6 primary to read-only, wait until the 8.4 replica has applied everything, switch the application's connection settings, and open writes on the new primary. With replication caught up, the write freeze takes minutes.
The old system stays available but read-only for a set period, for example two weeks, as the rollback option, together with its last backup. Rolling back to a much older version is not a simple reverse replication, so if we need it, we would export the changes made since cutover; that is another reason to test thoroughly before switching. After the period, we decommission it and add a second replica to the new setup, with regular backups and restore tests.
6Follow-up questions
Why not convert the tables to InnoDB on the current 5.6 primary first?
Because each conversion copies a table and blocks writes on MyISAM tables, and the primary has no replica to fail over to if something goes wrong. Converting on a replica gives the same result with no production risk, and we can measure the time and space it needs.
How do we know the converted data matches?
We compare row counts and checksums between the primary and the converted replica, for example with pt-table-checksum, which works across engines because it compares the data, not the files. Any table with nightly corruption repairs should be checked especially carefully, since it may already hold damaged rows.
What if a few tables really need MyISAM behaviour?
Almost none do. For AUTO_INCREMENT per group, the application or a small counter table can generate the sequence. For fast exact counts, a maintained counter or cached value works. We record any exception explicitly instead of keeping MyISAM.
7Conclusion
In this answer, we planned the move from a 10-year-old MySQL 5.6 system with 400 MyISAM tables. We made it safe first with a tested physical backup, binary logging and a replica, then inventoried tables, full-text indexes and application assumptions. We stepped through 5.7, 8.0 and 8.4 on a chain of replicas, converting to InnoDB on the first replica, and fixed the application for real transactions, possible deadlocks and different full-text behaviour. The cutover is a short write freeze, with the old system kept read-only as a rollback option for a set period.
Open with
I would sequence it so every step lowers risk first. Step one is safety: take a physical backup with XtraBackup, restore it to prove it works, enable binary logging, and build a replica, because right now one bad disk loses everything.
Then, if they want more
Step two is inventory: table sizes, engines, full-text indexes, and the application's MyISAM assumptions, such as fast COUNT(*) on whole tables, LOCK TABLES for consistency, MATCH AGAINST queries, rollbacks that were silently ignored, and per-group AUTO_INCREMENT, which InnoDB does not support.
Step three is the upgrade through replicas, since you cannot skip a release series: a 5.7 replica where I convert tables to InnoDB with ALTER TABLE ENGINE=InnoDB, then an 8.0 replica, then an 8.4 replica, running the upgrade checker at each step and checking disk space because InnoDB tables are bigger.
Step four is the application: transactions now really roll back, deadlocks become possible so I add retries, and full-text search has different stopwords, token size and ranking, so I compare results with the product owner.
Step five is cutover: read-only on the old primary, wait for the 8.4 replica to catch up, switch connections, open writes, and keep the old system read-only for a couple of weeks as the rollback option. Then I add a second replica and regular restore tests.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- MySQL 5.6
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- MySQL reference manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "An acquired company runs a 10-year-old MySQL 5.6 system with 400 MyISAM tables, nightly...": https://scrivio-interview-library.netlify.app/databases/mysql/aec76bd0f0/