Upgrade 2.16.3 to 3.0 a mess again

Mautic 2.16.3 - self-hosted on CentOS
PHP 7.2.30
MySQL 5.7.30

Updating Errors
I am Updating
Upgrading/installing via Web (and/or Command Line)

These errors are showing in the installer:

ERR_DOWNLOAD_UPGRADE_PACKAGE_FAILED: Downloading the Mautic 3 upgrade package has failed: Could not automatically download the package. Please download , place it in the same directory as this upgrade script, and try again. When moving the file, name it mautic-3-update-package.zip`.

These errors are showing in the Mautic log:

Nothing in the Mautic log; nothing dramatic happened yet.

upgrade_log.txt does not provide any additional information.

My problem:

Where am I supposed to download the correct upgrade package from?!

The installer previously complained that I had ‘installed Mautic by cloning from GitHub’, telling me that ‘we don’t support upgrading with the upgrade script in this scenario. Proceed at your own risk or reinstall with the official package at https://github.com/mautic/mautic/releases/tag/2.16.3 …’

Which is the exact same location where I got my upgrade script. Did I pick the wrong link from that page?

Very confused now. Can someone give me an exact link for the zip I need to proceed? Why is it not included in the error message? Why can’t the installer find its own upgrade script?

1 Like

Hi there,

Sorry to hear you’re having problems. The pre-flight checks are there purposely to stop upgrades where we expect there to be problems encountered.

If you previously installed from Github we don’t support upgrading in that scenario - some folk have come across issues with this upgrade when we were in the beta phase.

We recommend using the official package which you can download on Github via the releases (2.16.3 is here as linked in your message above).

You should be able to spin up a 2.16.3 instance from the release package, and simply import over your assets and then connect up your database with the local.php from your existing instance.

2.16.3 contains the upgrade script in the root of the directory.

If the script is saying it can’t download the package I’m guessing there might be an issue with ports being open or Curl not being available. It is calling out to Github to get the latest version of Mautic 3 in order to download that file to your server, unpack it, and kick off the migration. Something in that process is not working. Here’s the info on the docs for that error message.

To manually download, 3.0.2 is the current release that you’d be upgrading to which you can find here. I believe (but have just checked with @dennisameling who wrote the script) that you’d need the full package - download it, drop it into the same directory as your upgrade script (usually this is the root of your Mautic instance unless you have changed it) and name it as instructed - mautic-3-update-package.zip.

Hope that helps!

1 Like

@modifiedcontent
What @rcheesley mentioned is completely correct. You’ll need to download the full 3.0.2 package for the upgrade from 2.x to 3, due to some file system changes. The direct link to that package is https://github.com/mautic/mautic/releases/download/3.0.2/3.0.2.zip.

Nevertheless, I’m curious why the script isn’t working properly for you. If you try curl https://github.com/mautic/mautic/releases/download/3.0.2/3.0.2.zip --output mautic-3-update-package.zip, does that work? Then the upgrade script should also work, as it will try to download the package from that URL.

Hope we can get you up and running with Mautic 3 this way! :rocket: Do let us know if you run into any other issues.

2 Likes

Thanks for the response rcheesley. As said, I did get my package to update to 2.16.3 from the same Github link, but I used 2.16.3-update.zip from there - I am not going to ‘spin up’ a brand new 2.16.3 instance, I have a production installation. So 2.16.3-update.zip doesn’t work for the 3.0 upgrade?

I’ll follow the other suggestions next and report back soon…

2.16.3 upgrade is the package that is used when upgrading a 2.x instance to 2.16.3. 2.16.3 includes the 3.x upgrade script as mentioned.

The 3.0.2 package is the one you’d need to grab and drop into your Mautic directory as mentioned - let us know if you have any problems (and it would be helpful to check the curl command as above to see if that’s where the issue lies)

We can look to improve the error code documentation as it is pretty sparse (was written when we were very short on time before the release) - if you’d have time to help with that there’s and edit on Github link at the bottom of the page in the docs!

1 Like

Thanks dennisameling. curl Mautic · GitHub… etc. worked.

I had one other warning the first time I tried the upgrade:

The following warnings occurred while checking system compatibility:
We can’t make a database backup for you due to restrictions on your system. Only continue if you have your own database backup available!

I did have my own backup, so moved on.

Second attempt:

Version 3.0.1 of Mautic is available for download. Please visit this announcement for more information. [update now]

Clicked [update now] with the mautic-3-update-package.zip for 3.0.2 in the folder - will the mismatch cause more problems?

Same database backup warning as last time; moving on again.

The upgrade script now passes ‘Downloading Mautic 3 upgrade package…’, but fails on ‘Extracting Mautic 3 files…’:

ERR_EXTRACT_UPGRADE_PACKAGE_FAILED: Error while extracting Mautic 3 files: Could not open or read update package…

No additional info in upgrade_log.txt

Is the fact that I’m on CentOS a problem? Is the upgrade for Ubuntu only?

Or permission issues? Does the script assume a particular user name?

Where are the manual upgrade / command line instructions?

I have tried to manually upgrade with the following command:

php app/console mautic:update:apply --update-package=mautic-3-update-package.zip

This produces the following error:

The Mautic update could not complete successfully because of the following error: The ZIP archive does not seem to be valid. Please check your cache directory and delete the package then try again.

I see the file mautic-3-update-package.zip is only 1 Kb and only contains the following:

<html><body>You are being <a href="https://github-production-release-asset-2e65be.s3.amazonaws.com/12204147/8f3bf180-cffc-11ea-855a-4a646bb3a0f2?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200814%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20200814T131300Z&amp;X-Amz-Expires=300&amp;X-Amz-Signature=974620a1049a6015222996fdd4e324b25c1a0386b0140651d3b8938a195c8716&amp;X-Amz-SignedHeaders=host&amp;actor_id=0&amp;repo_id=12204147&amp;response-content-disposition=attachment%3B%20filename%3D3.0.2.zip&amp;response-content-type=application%2Foctet-stream">redirected</a>.</body></html>

I downloaded the package using this instead:

wget https://github.com/mautic/mautic/releases/download/3.0.2/3.0.2.zip

Then manually renamed it to mautic-3-update-package.zip and ran the [update now] button again. The upgrade process now successfully moved beyond ‘Extracting Mautic 3 files’, entered new parameters in config/local.php and then failed on Applying Mautic 3 database migrations…:

ERR_MAUTIC_3_MIGRATIONS_IDENTIFICATION_FAILED: We couldn’t reliably detect the amount of available database migrations. Please try again by refreshing this page…

Luckily the process resumed after refreshing the page and actually made it to the end.

Now checking the installation, fixing cron jobs, etc. … Everything seems OK so far.

I am having EXACTLY the same error as you, so I thought I’d be lucky and do the update on the browser. (Up to now I tried several times on the CLI with this same results).

Got to the point you got and hit refresh… to no avail! :frowning:

This is my error… I’ll probably create a new thread for this…

It was worth a try!

For updates I still kinda rely on this advice.

That page includes 3 commands that Yosu Cadilla recommends to run before upgrade attempts:

php app/console doctrine:migration:migrate
php app/console doctrine:schema:update --force
php app/console cache:clear

Your error has to do with migrations, so have you tried the first? Or probably just do all three.

Also make sure you are using the right update package.

Also, what database type/version are you on? I had just upgraded from MySQL 5.7.30 to MariaDB 10.3.24 before my last attempt. I think Mautic 3 had some special db requirements.

1 Like

This is what worked for me too. I spent 5 days trying everything else!

1 Like

Hi all!
I’m running version 2.15 .1 how can I upgrade to version 3?

Disclaimer: I’m a human, not a developer

Hey there, luckily you just need to be human :wink:

  1. Take a backup of your files and your database, and check that they are OK by installing it locally or in some other folder
  2. Update to 2.16.5 (ideally you should try to do this at the command line if possible)
  3. Check that you are not running any customised plugins - they will need to have a 3.x compatible version before you update, so you will need to remove them from the plugins folder
  4. Update to 3 using the upgrade script at mautic.example.com/upgrade_v3.php - again it is preferable to do this at the command line. This will run some checks to tell you if there are any issues that you will need to address before you can proceed with the update.

If you are not able to do this, then you might well want to hire someone to do the update for you.

If upgrade via the admin area button doesn’t work, use SSH/command line - as regular user, not root! - and navigate to your installation directory, something like this:

cd /home/username/public_html/mautic

Then run these if you are still on 2.15:

php app/console doctrine:migration:migrate
php app/console doctrine:schema:update --force
php app/console cache:clear

After version 3 you should use:

php bin/console doctrine:migration:migrate
php bin/console doctrine:schema:update --force
php bin/console cache:clear

Find the upgrade file. With some puzzling you should be able to find them on links like these:

https://github.com/mautic/mautic/releases/tag/3.2.5

Download and install the version you want to upgrade to:

wget https://github.com/mautic/mautic/releases/download/3.2.5/3.2.5-update.zip
php app/console mautic:update:apply --update-package=3.2.5-update.zip

Or after version 3 use bin instead of app:

php bin/console mautic:update:apply --update-package=3.2.5-update.zip

And apparently you may need this at the end:

php bin/console mautic:update:apply --finish

I am not 100% sure if you can jump from 2.15 to 3.2.5 with this method. If you don’t want to risk it, maybe try an upgrade to an older version first.

Confidence level 8 for a version 2.15 to 2.16.5 upgrade, using this package:

https://github.com/mautic/mautic/releases/download/2.16.5/2.16.5-update.zip

Confidence level 8 for a version 2.16.5 to 3.0.2 upgrade, but note that you have to use this package for some reason (see dennisameling’s comment earlier):

https://github.com/mautic/mautic/releases/download/3.0.2/3.0.2.zip

Confidence level 9 for a version 3.0.2 to 3.2.5 upgrade, using this package and ‘bin’ instead of ‘app’ in the commands:

https://github.com/mautic/mautic/releases/download/3.2.5/3.2.5-update.zip

Confidence level 6 for a big jump version 2.15 to 3.2.5 upgrade, using this package:

https://github.com/mautic/mautic/releases/download/3.2.5/3.2.5-update.zip