How to Update Mautic from the Command Line

pexels photo 289927 2 1

Updating Mautic often makes your stomach feel chilly. With the arrival of version 2.0 the development team offered a new way to update the platform somewhat different from what we already presented here in this video at the time of version 1.4.

With this new command, we gained more stability and consistency when updating database migrations, the script also clears the cache folder and corrects some file permissions.

This command applies to all Mautic since version 2.0.

Basically the process consists of downloading a php script and running this script inside the root folder of your installation. Let's go step by step?

Important: Run a backup of your files and database before upgrading.

Downloading the upgrade.php script to update mautic

Open your terminal and connect to your VPS. Now open the folder where your Mautic is installed. Look:

passo01

Now type the command below to download the Mautic update script:

wget https://github.com/mautic/mautic/raw/staging/upgrade.php
passo02

You will have an output like this:

assine newsletter

Receba Conteúdo exclusivo

Newsletter Exclusiva sobre Mautic, n8n, Entregabilidade e Ferramentas de NoCode / LowCode para Marketing.

passo3

Update Mautic

Now that you have the script in the Mautic root folder, run the following command:

php upgrade.php
passo04

Wait for the progress of the update which takes a few seconds and that's it.

passo05

Your Mautic is up to date but we still have one last step to make sure everything works perfectly!

Updating permissions after updating Mautic

Finally, don't forget to reset the folder permissions. In our case we use Digital Ocean and by default a LAMP machine uses the user “www-data” and also the group “www-data” to access the files via apache. Type the command below into the mautic folder:

chown -R www-data:www-data .
chmod -R g+rw .

Now you can use Mautic without any problems. Be sure to check out our Guide to Updating the Cache and Adjusting Mautic Permissions.

Updating the database schema

Another factor that can help upgrade problems is to update the database schema on the command line.

Nesse grupo conversamos sobre Inbound Marketing, Estratégias, Mautic, N8N, Entregabilidade, Metabase e Wordpress. Não fique de fora!

Responses

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.