SQL Joomla! 6 Joomla! 5 Joomla! 4 Database Intermediate

Convert Legacy Joomla Tables to InnoDB and utf8mb4_unicode_ci

Generates exact ALTER TABLE statements from information_schema to migrate legacy utf8mb3/MyISAM tables cleanly to utf8mb4 and InnoDB.

Updated on 24 November 2026 46 copies 156 views
sql/convert_utf8mb4.sql
-- Gera os comandos ALTER TABLE para todas as tabelas que ainda não estão em InnoDB + utf8mb4
SELECT CONCAT(
    'ALTER TABLE `', TABLE_NAME,
    '` ENGINE=InnoDB CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'
) AS ddl_statement
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE()
  AND TABLE_TYPE = 'BASE TABLE'
  AND (ENGINE <> 'InnoDB' OR TABLE_COLLATION NOT LIKE 'utf8mb4%');
Take a full UTF-8 (no BOM) database dump before running the generated ALTER TABLE statements.

Technical explanation and best practices

During Joomla 3 to 5/6 upgrades or MySQL 5.7 to 8.4/9.x migrations, legacy third-party tables often stay on utf8mb3 or MyISAM. Run this query to produce safe conversion DDL statements.

Direct Engineering

Have a Joomla project or technical challenge in mind?

From architectural diagnosis to production deployment, directly with the engineer.