I ran into a similar issue going from 4.1.x to 4.2. on MariaDB
The process failed at bin/console mautic:update:apply.
The log indicated :Error thrown while running command “doctrine:migrations:migrate --quiet --no-interaction”. Message: "An exception occurred while executing ‘ALTER TABLE maup6_lead_event_log
RENAME INDEX IDX_SEARCH
TO maup6_IDX_SEARCH
’:
I manually created maup6_IDX_SEARCH using the same values as IDX_SEARCH, then deleted IDX_SEARCH.
I then reran at received a new error:
console.CRITICAL: Error thrown while running command “doctrine:migrations:migrate --quiet --no-interaction”. Message: “An exception occurred while executing ‘ALTER TABLE maup6_email_stats
CHANGE COLUMN tokens
tokens
LONGTEXT CHARACTER SET ‘utf8mb4’ COLLATE ‘utf8mb4_unicode_ci’ NULL DEFAULT NULL COMMENT ‘(DC2Type:array)’;’: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘danianim_maut458
.parcr
.date_sent
’ in ‘GENERATED ALWAYS’” {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0):
Reran apply and received the happy congratulations 4.2 message, but the site 403s.
then ran the dump sql script that returned 155 updates:
Took a back up, then ran the same script with --force which returned the FK errors above.
Not sure why my db is so far out of wack as every previous upgrade as executed successfully.
I can start stepping thru each update and debugging, but not sure that’s best approach.