If you just switched from a regular (github/file copy) deployment of your Mautic to composer based management, you will meet your first challenge. How do I update?

In this tutorial I’m going to show you step by step how it is done.

Since Mautic 5.1 -> 5.1.1 is a smaller update, this tutorial might not work for ‘major’ versions. But I will do my best to update it, and make it work with larger updates as well.

Step 1: Let’s edit our composer file

cd /var/www/html/mautic
nano composer.json

This can be different based on where your Mautic is located.

Step 2. Change the Mautic Version

Change the following line from:

"mautic/core-lib": "5.1.0",

To:

"mautic/core-lib": "5.1.1",

Step 3: Composer Update

composer update --with-dependencies

After executing this, composer will read your composer.json and pull down all the new stuff, including the new Mautic files.

Step 4: Migrations

Run the migrations below. I have to admit, I didn’t run the one marked red, it just seems unnesseccary.

bin/console cache:clear
bin/console mautic:update:apply --finish
bin/console doctrine:migration:migrate --no-interaction # sudo -u www-data
(optional) bin/console doctrine:schema:update --no-interaction --force sudo -u www-data
bin/console cache:clear

Troubleshooting

I had some issues first, and as I’m updating all my Mautics, I’ll add more hints here for you how to fix possible errors:

  1. Make sure the user, which uses composer has the right to access all files, especially the composer.json.

Leave a Reply

Your email address will not be published. Required fields are marked *