Symptoms
-
The migration of a database fails with the following error:
Failed to copy content of database 'johndoe_db' Migration tools tried to perform operation in 3 attempts: Command execution failed on the local server with non-zero exit code. command: mysql --defaults-file=/usr/local/psa/var/modules/panel-migrator/sessions/20181121171003/target-server/my_localhost_johndoe_db.cnf -h localhost -P 3306 -uadmin wp_ke32j < /usr/local/psa/var/modules/panel-migrator/sessions/20181121171003/target-server/db-dumps/johndoe_db.sql exit code: 1 stdout: stderr: ERROR 1071 (42000) at line 479: Specified key was too long; max key length is 767 bytes
-
The same issue occurs during the database import
-
The version on the target server is less than:
MariaDB 10.2.X:# mysql -V
mysql Ver 15.1 Distrib 10.1.37-MariaDB, for Linux (x86_64) using readline 5.1
MySQL 5.7.X:
# mysql Ver 14.14 Distrib 5.6.42, for Linux
(x86_64) using EditLine wrapper
Cause
The limitation on the key length in the current MySQL version on the target server. In MySQL 5.7 and upwards this limit has been increased to 3072 bytes.
Note: The equivalent of MySQL 5.7 is MariaDB 10.2.
Resolution
Upgrade MariaDB to the 10.2.X or MySQL to the 5.7.X version on the destination server by using instructions from this article:
How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.0/10.1/10.2 on Linux