Closed DeamonMV closed 3 years ago
Also ran into this one when attempting to run the /var/www/html/console core:convert-to-utf8mb4
script. Going to see if there is a way to get around the FK constraint.
This is probably not the best way to get around the foreign key constraint but you can add SET FOREIGN_KEY_CHECKS = 0;
to the DB upgrade queries and then set it back to SET FOREIGN_KEY_CHECKS = 1;
after the DB upgrade is completed. Just tested this out using the following code snippet in the /var/www/html/plugins/CoreUpdater/Commands/ConvertToUtf8mb4.php
file:
Line 87:
$output->writeln("\n" . Piwik::translate('CoreUpdater_ConsoleStartingDbUpgrade'));
Db::get()->exec("SET FOREIGN_KEY_CHECKS = 0;");
foreach ($queries as $query) {
$output->write("\n" . 'Executing ' . $query . '... ');
Db::get()->exec($query);
$output->write(' done.');
}
Db::get()->exec("SET FOREIGN_KEY_CHECKS = 1;");
@markwooff Thank you for your workaround.
Update went well.
@markwooff Thank you for your workaround.
The update went well for me too.
Hello
We have updated our matomo 3.x installation to new version 4.0.4 - looks like it’s all going well, but update tables to use utf8mb4 have problems.
this is looks like this
As I understand this because of LoginOIDC adds a foreign key constraint to the database that disallows the changes needed for the conversion.
My origin post on matomo forum.
Can someone help to resolve it. Thank you.