Error updating Mautic 2.16.4 to 3.2

I successfully updated from Mautic 2.14.2 to Mautic 2.16.4 using the Web gui update.

I have updated my PHP to 7.3.25

My MySQL/MariaDB version is: 10.3.24-MariaDB-Cll-lve

I am having Updating Errors when trying to update from 2.16.4 to 3.x during the database migration part of the upgrade.

I have attempted to upgrade using the Web and when it failed I restored to my backup of 2.16.4 and then attempted to upgrade using Command Line and the “php upgrade_v3.php” command. It failed on the 2nd time running the command.

I seem to be getting the same type of error each time with the database migration step.

Also, before attempting to update with the command line I also ran the recommended commands from Step 2 Verify the Health of Your Current Version from https://mauteam.org/mautic/mautic-admins/mautic-update-how-to-dont-click-that-button/ but this did not eliminate the errors.

As prompted in the error output I ran the following command:

php bin/console doctrine:migrations:migrate --no-interaction --env=prod --no-debug

Here is the error output:

[2020-12-10 18:37:46] ++ adding generated column generated_sent_date
[2020-12-10 18:37:46] -> ALTER TABLE maugc_email_stats ADD generated_sent_date DATE AS (CONCAT(YEAR(date_sent), “-”, LPAD(MONTH(date_sent), 2, “0”), “-”, LPAD(DAY(date_sent), 2, “0”))) COMMENT ‘(DC2Type:generated)’;
ALTER TABLE maugc_email_stats ADD INDEX maugc_generated_sent_date_email_id(generated_sent_date, email_id)

In AbstractMySQLDriver.php line 79:

An exception occurred while executing ‘ALTER TABLE maugc_email_stats ADD ge
nerated_sent_date DATE AS (CONCAT(YEAR(date_sent), “-”, LPAD(MONTH(date_sen
t), 2, “0”), “-”, LPAD(DAY(date_sent), 2, “0”))) COMMENT ‘(DC2Type:generate
d)’;
ALTER TABLE maugc_email_stats ADD INDEX maugc_generated_sent_d ate_email_id(generated_sent_date, email_id)’:

You have an error in your SQL syntax; check the manual that corresponds to
your MariaDB server version for the right syntax to use near ‘ALTER TABLE m
augc_email_stats ADD INDEX maugc_generated_sent_date_email_id(…’ at lin
e 2

In MysqliStatement.php line 86:

You have an error in your SQL syntax; check the manual that corresponds to
your MariaDB server version for the right syntax to use near ‘ALTER TABLE m
augc_email_stats ADD INDEX maugc_generated_sent_date_email_id(…’ at lin
e 2

doctrine:migrations:migrate [–write-sql [WRITE-SQL]] [–dry-run] [–query-time] [–allow-no-migration] [–all-or-nothing [ALL-OR-NOTHING]] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–] []

From searching on the internet I found 2 articles on github that discuss similar errors, but I do not understand how to correct the problem.


Can someone please explain more plainly the steps I need to take to correct the SQL problem so I can do the upgrade?

Or in the alternative, is there a way for me to be able to bring in my contact data, customization, email templates, etc. from my 2.16.4 into a fresh install of Mautic (I can do a fresh install of 3.2.1 on my hosting company cpanel using softaculous)