Hey, is this an instance, that you upgraded from M2 ? There was an issue with the M2->M3 upgrades which caused the same problems. I also have a couple of instances, that are stuck with 3.3.3 because of the same reason.
Migrations won’t run due to key constrains.
I looked at:
| Field | Type | Null | Key | Default | Extra |
| id | int(11) | NO | PRI | NULL | auto_increment |
I also have an oauth2_clients table without the ‘ma_’ that I believe was created at 3.3.1 but never used due to an incorrect prefix on clean install and restore of data at that release. This uses int(10) unsigned for the ids. Another difference is that these unused tables are utf8mb4 while the used tables are plain utf8.
I’m also experiencing an error upgrading from 3.3.4.to 4.0 or 4.0.2
Error: Interface ‘Bazinga\OAuthServerBundle\Model\AccessTokenInterface’ not found - in file /home/xxxxxxxxxxxx/xxxxxxxxx.xxxxxxxxxxxxxxxxxxx.com/app/bundles/ApiBundle/Entity/oAuth1/AccessToken.php - at line 23
Is this a database issue also?
I would appreciate suggestions on how to move forward to upgrade to 4.0.2. Thank you.
Hi everyone. I leave the version to 3.3.4 for a few months and this morning i started to figure out how to update. Searching on forum and git i saw that during update a field is added to the oauth_clients table and this field refers to the role id field.
the problem is that the new field role_id is unsigned but role ID field is not. So i found this solution: change the table roles field ID adding the unsigned attribute.
this is not as simple as it seems to be because there are various foreign key involved anyway i found the right sql commands to execute.
These are the steps to upgrade via CLI:
enter into the mautic dir
digit php bin/console mautic:update:find
digit php bin/console mautic:update:apply
open phpmyadmin, select the database, click SQL, paste the query below end execute
# Apache 2.4+
# Deny access via HTTP requests to all PHP files.
# <FilesMatch "\.php$">
# Require all denied
ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9D60322AC;
ALTER TABLE `users` CHANGE `role_id` `role_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE permissions DROP FOREIGN KEY FK_2DEDCC6FD60322AC;
ALTER TABLE `permissions` CHANGE `role_id` `role_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `roles` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `permissions` ADD CONSTRAINT `FK_2DEDCC6FD60322AC` FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON DELETE CASCADE ON UPDATE RESTRICT;
ALTER TABLE `users` ADD CONSTRAINT `FK_1483A5E9D60322AC` FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;