(Solution) Unknown collation: utf8mb4_0900_ai_ci

After doing a bit of research, I found that the MySQL server running on the destination is an older version than the source server.

It came down to making a small adjustment to the backup file to fix this.

I edited the database backup file in a text editor and replaced "utf8mb4_0900_ai_ci" with "utf8mb4_general_ci" and "CHARSET=utf8mb4" with "CHARSET=utf8". Linux users can use the sed command to replace text in files directly.

sed -i 's/utf8mb4_0900_ai_ci/utf8_general_ci/g' backup.sql
sed -i 's/utf8_general_ci/utf8mb4_general_ci/g' backup.sql

After the changes above, the database was restored successfully!

Need a Drupal Expert?

Senior Drupal developer, freelance, specialized in what's hardest: migrations, multilingual sites, SaaS platforms and Stripe integration. I leverage AI to cut delivery times and costs, with expert review on every line of code.

No agency, no middlemen. Direct contact with the one who does the work.