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.
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
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…
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
In order to proceed, we need all database migrations for Mautic 2 executed on your instance. You can trigger that process with app/console doctrine:migrations:migrate, which will most likely give you the error you posted above.
I looked at the specific migration and can you please do the following:
Open app/migrations/Version20180329185634.php
Remove line 32, which has this code in it: $this->addSql("ALTER TABLE {$this->prefix}lead_event_log DROP FOREIGN KEY $fkName"); --> please don’t touch other parts of this file!
Run app/console doctrine:migrations:migrate again. Fingers crossed you won’t see any other errors now
If the migrations succeeded, try to open the Mautic 3 upgrade script again.