Mautic Community Forums

Upgrade v2.16.0 to v3.0.2

Your software
My PHP version is : 7.3

I’m want to upgrade from v2.16.0 to v3.0.2 - I’ve read the following https://docs.mautic.org/en/mautic-3-upgrade/upgrade-steps however this is specifically for upgrading from v2.16.3 or above.

What is the best approach?

Do i need to upgrade to a v2 build e.g. v2.16.3 and then do a further upgrade to v3.0.2 or can I upgrade straight from current to latest version?

1 Like

You must update first to 2.16.3 - there is no other upgrade path. See the pre-flight check:

  • Do you at least have Mautic 2.16.3 installed?

So you will need to do 2.16.0 -> 2.16.3 and then you can upgrade to 3.x. Of course, ensuring that you have a backup that is tested, and ideally at the command line.

1 Like

To confirm the update that is needed initially is this the 2.16.3-update.zip from this page:

Then it’s a case of upgrading using the published steps at:

Correct?

Just use the command:

mautic:update:find

followed by

mautic:update:apply

per the docs here: https://docs.mautic.org/en/setup/updating-at-command-line#checking-for-updates

You will not be offered the 3.x packages unless you are on 2.16.3 so it is fine to use the regular update commands.

Once. at 2.16.3 run the commands again, it will take you through the migration step by step at the command line when you do the update.

Great, that all makes sense.

I’ve had to substitute php bin/console mautic:update:find for php app/console mautic:update:find but that has started the process.

It’s unpacked but then thrown up the following:

[Symfony\Component\Debug\Exception\FatalThrowableError]
Type error: Argument 1 passed to Mautic\CoreBundle\Helper\LanguageHelper::__construct() must be an instance of Mautic\CoreBundle\Helper\PathsHelper, instance of Mautic\CoreBundle\Factory\MauticFactory given, called in /home/per/email.domain.com/app/cache/prod/appProdProjectContainer.php on line 11412

There are then the options:

mautic:update:apply [–force] [-p|–update-package [UPDATE-PACKAGE]] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-s|–shell] [–process-isolation] [-e|–env ENV] [–no-debug] [–]

@rcheesley any help/input from your end massively appreciated.

Hi there,

Search is your friend … it turned up this thread: Impossible to update from 2.16.0.

Try changing the language of your instance to en_US?

Seemingly the language is already set to English - United States

!

Hmmmm…

Any further ideas/suggestions?

Is it worth deleting the contents of /home/per/email.domain.com/app/cache perhaps?

Yes, deleting the cache is a good starting point!

Very strange, although I unpacked previously but didn’t proceed with the upgrade via Terminal, today it’s now showing that Mautic is running 2.16.3 (weird).

So I’ve run php upgrade_v3.php

Then run yes to proceed.

It then says that there is a warning due to pending emails not sent (that i’m not worried about) and that it can’t make a database backup due to restrictions on the system.

It then says only continue if you have your own database backup available! which I do, however I’m unsure what command to run to continue the update…

@voisd you can run php upgrade_v3.php --ignore-warnings which skips these warnings and proceeds with the upgrade. Hope that helps :blush:

Ok, so that got it going, it got a little way into the upgrade and then flagged a DROP FOREIGN KEY error.

ALTER TABLE maukf_lead_event_log DROP FOREIGN KEY FK_A73AD4C755458D
Migration 20180329185634 failed during Execution. Error An exception occurred while executing ‘ALTER TABLE maukf_lead_event_log DROP FOREIGN KEY FK_A73AD4C755458D’:

Can’t DROP FOREIGN KEY FK_A73AD4C755458D; check that it exists

[Doctrine\DBAL\Exception\DriverException]
An exception occurred while executing ‘ALTER TABLE maukf_lead_event_log DROP FOREIGN KEY FK_A73AD4C755458D’:

Can’t DROP FOREIGN KEY FK_A73AD4C755458D; check that it exists

[Doctrine\DBAL\Driver\Mysqli\MysqliException]
Can’t DROP FOREIGN KEY FK_A73AD4C755458D; check that it exists

doctrine:migrations:migrate [–write-sql] [–dry-run] [–query-time] [–allow-no-migration] [–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] [-s|–shell] [–process-isolation] [-e|–env ENV] [–no-debug] [–] []

Any next step suggestions?

I’ve since:

Run the steps from this article however stopped prior to trying to update files manually at this stage.

Attempt to add the appropriate missing key (as stated in this article) however all I managed to get was the folllow mySQL error.

Any thoughts/suggestions?