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.
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)
- backup db & files
- clear cache
- fetch mautic latest version from github
- run update using FILE method, rather than looking for the latest upgrade
- fix any upgrade messages which might occur - force command
- migrate db if needed
- starts cache warming
- 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.
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:
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?
I will also be grateful if you share the script