Safest way to upgrade to Mautic 4.x

Lately we have had to move most of our customers to 4.x and have run into numerous issues with upgrading.

I have also seen a number of posts on the forum about problems updating and certain things not working correctly,

As such we have gone ahead and written out a fail-proof way of upgrading your Mautic instance without having to disrupt your production environment.

Check out out latest blog on this here.

2 Likes

@mikew
We have been updating mautic since v2 from CLI without issues.
We do not use the upgrade in the back-end, as it never seems to work 100%.

We now have written a script which basically does the following (note all CLI functions)

  1. backup db & files
  2. clear cache
  3. fetch mautic latest version from github
  4. run update using FILE method, rather than looking for the latest upgrade
  5. fix any upgrade messages which might occur - force command
  6. migrate db if needed
  7. starts cache warming
  8. run file permissions / ownership rules

Once this is done - which generally takes about 10min we then test the site.
99% of the time we have not had issues.

The above works for us. Since we have a backup before upgrade, we can roll back the backup with a few commands.

The mautic CLI is pretty good with commands and worth exploring.

M.

1 Like

Thank you for share, could you explain more about step 4: " run update using FILE method, rather than looking for the latest upgrade", what commands do you use? Maybe:

wget https://github.com/mautic/mautic/releases/download/3.3.4/3.3.4-update.zip
php bin/console mautic:update:apply --update-package=3.3.4-update.zip
php bin/console mautic:update:apply --update-package=3.3.4-update.zip --finish

Could you share your full script every steps?

Would you be open to sharing the script?

1 Like

I will also be grateful if you share the script