Database error during upgrade from 12 to 13

Hello,

I a running dolibarr 12.0.5 on a Docker, and wanted to update it to 13.0.1. I followed the usual steps, but during the database update I get the following errors:

Erreur DB_ERROR_1071: ALTER TABLE llx_recruitment_recruitmentcandidature ADD UNIQUE INDEX uk_recruitmentcandidature_email_msgid(email_msgid);
Specified key was too long; max key length is 767 bytes

I check the character-set and it is set to tf8mb4_general_ci.

Any ideas of what is going on ?

Yes,

You need to change to utf8_general_ci not the mb4

Thanks for your quic answer @ksar.

I converted the DB to utf8_general_ci , but error stay the same:

Server connection : db	OK
Database connection : dolibarr	OK
Database server version	5.5.5-10.1.47-MariaDB-0ubuntu0.18.04.1
Client charset	utf8
Client collation	utf8_unicode_ci
Please be patient...
Choose migration script	12.0.0-13.0.0.sql
Error DB_ERROR_1071: ALTER TABLE llx_recruitment_recruitmentcandidature ADD UNIQUE INDEX uk_recruitmentcandidature_email_msgid(email_msgid);
Specified key was too long; max key length is 767 bytes

Any ideas ?

Hello;

Could you check that the table

llx_recruitment_recruitmentcandidature

is utf8_general_ci ?

Thanks @ksar. You were right this table and a few others were still in utf8mb4_general_ci.

Upgrade complete. Thanks!

1 Like

Hi, I get error 504 when upgrading from 12.0.3 to 13.0.3.
All prerequisite checks are OK and I get the choice to update 12.0 to 13.0.
I did install/repair.php?force_utf8_on_tables=confirmed but still get the same error 504.
The first step of data migration seems to go well, I get around 240 lines when asking for details but when I click next step I get error 504 after around 3 minutes.
Any details did I miss ?

Hi,

Error 504, means that you reach the PHP timeout.

if you can change the PHP configuration, change this line in the PHP.ini :

max_execution_time = 300

Thank you Ksar, I tried 300 and 500 (it was 240 initially) but still got error 504. (I restarted the server in between trials to make sure php param are taken into account.)
The install is on DSM6, I also tried to give all r/w rights on Dolibarr but still error 504.
It worked well when I did update 11 to 12 but not this time.
Any idea please ?

Then do the migration on a more powerful server and re-import in DSM6

Thank you so much for your quick answer.
I am afraid I am too novice to do so.
I also tried to install a fresh 13 connected to old db but same arror 504 ;(

OK I found the fix : switch default back-end server from Apache to Nginx !
I also needed to give r/w access to core folder from http (as with documents and conf folders).