# MySQL error upgrading to 4.2

**URL:** <https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [March 1, 2022, 5:29pm UTC](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867 "2022-03-01T17:29:15Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![patrickeidemiller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/patrickeidemiller/32/511_2.png) [@patrickeidemiller](https://forum.mautic.org/u/patrickeidemiller)\
**Post date:** [March 11, 2022, 5:54am UTC](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867/21 "2022-03-11T05:54:36Z")

</div>

> [@cwmarketing](#):
>
> hp bin/console doctrine:migration

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.

 ![SS 2022-03-10 at 9.01.55 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/2c13b8016800d9b69d965cb6fb6b9b82b328b3ec.png)

then ran the dump sql script that returned 155 updates:

 ![SS 2022-03-10 at 9.50.30 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/ad680420a2ef9c631fe0902b1265d0a5fdb7d892.png)

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.

---

_[View the full topic](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867)._
