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:
Get Mautic content directly to your inbox
Now type the command below to download the Mautic update script:
You will have an output like this:
Now that you have the script in the Mautic root folder, run the following command:
Wait for the progress of the update which takes a few seconds and that’s it.
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.