OpenCart — UASK.PRO

MyISAM to InnoDB in OpenCart

Old OpenCart databases are mostly MyISAM. What that does to backups and migrations, and how to convert tables safely.

Older OpenCart installs keep almost everything in MyISAM tables. Three consequences matter in practice:

See what you have

SELECT engine, COUNT(*) FROM information_schema.tables
WHERE table_schema = DATABASE() GROUP BY engine;

Convert

Generate the statements, smallest tables first and the order tables last:

SELECT CONCAT('ALTER TABLE `', table_name, '` ENGINE=InnoDB;')
FROM information_schema.tables
WHERE table_schema = DATABASE() AND engine = 'MyISAM'
ORDER BY data_length ASC;

Run them table by table, not all at once. Measure the time of the large tables on a copy first.

Check afterwards

See also: Can this shop be upgraded?.