Mautic moved to a rapid release schedule beginning with version 2.4. With upgrades to Mautic coming more often, how should you prepare? It’s a huge win for the users, and brings the project in line with the rest of the marketing technology industry.
Though each release will be lighter on new features, the platform will become more stable and secure. This is a truly assuring step in Mautic’s coming-of-age as the world’s #1 open source marketing automation platform.
Despite the fanfare around each release, upgrading Mautic can be a nerve-racking chore, especially for less-technical users. Before you hit “Update Now” in the dashboard, we wanted to share some tips how you can:
- Backup your database before a Mautic upgrade
- Maximize your chances of a trouble free Mautic upgrade
- Recover from a failed Mautic upgrade
Backup your Mautic Database and Files
The most critical data of your Mautic installation, including contacts, custom fields and settings are stored in your MySQL database. That’s why it’s imperative to back it up before running a Mautic upgrade. With a backup of your Mautic database, you can reinstall Mautic in the worst-case scenario without losing months or years of data.
If you are running Mautic on a hosting account with phpMyAdmin, you can use the Export wizard to create a dump of your database. With a cPanel host, you can access phpMyAdmin under the Databases pane of your control panel.
Then, navigate to the database name corresponding to your Mautic installation in the left pane. Once the tables for that database loads, select the “Export” tab. Leave the Format as “SQL” and click “Go.” The database will download to your computer as a file in .sql format.
To backup your MySQL database from the command line, SSH into the machine that hosts your MySQL server and use the following command. It will dump the contents of your Mautic database into a .sql file in the current directory, which you can download via SFTP.
mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql]
Besides the database, your media files, email and landing page themes are stored as flat files in your Mautic directory. While there is little likelihood that the update process will damage these files, you can download your entire Mautic directory as a backup, or alternatively just these folders via FTP:
Mautic Upgrade Best Practices
- Backup your database, media and template files before updating Mautic
- Run the update in your dashboard from a desktop PC with a stable Internet connection
- If you have SSH access, download the update script from Mautic and run it as root your Mautic directory. It is more stable compared to updating in the dashboard.
- Consider waiting a few days after a Mautic release comes out and seeing if other users on the Slack chat or community forum encountered any problems, and how they solved them.
- Refresh the page while the update is taking place
- Attempt the update from a mobile device, unless absolutely necessary
- Schedule the update during a peak traffic period to your website
Recover from a Failed Mautic Upgrade
If despite your best efforts, your Mautic upgrade has failed (it happens); What should you do? Hopefully you’ve already taken a backup of your database and files, but if not, create one now. This way you can’t damage your installation any more than has been already done.
John Linhart, one of the developers of Mautic, has written an excellent guide of commands you can try in Mautic’s console to try and recover from a failed Mautic update. These include clearing the cache, trying to rerun the update from the command line, migrating and rebuilding the database schema.
If you don’t have SSH access, Linhart has also provided a PHP file you can upload to your Mautic directory that allows you to issue the console commands from a browser.
If you’re still stuck, it might be time to contact a professional for help. We have helped clients recover from failed Mautic upgrades that were a result of database and permissions errors. If you have a backup, we can also help you restore it and retry the upgrade. Once Mautic is up and running again, one of our experts will go through our checklist to ensure overall system health, including:
- Rebuild forms
- Update the IP lookup database
- Reauthenticate any active integrations
- Check for messages in the error log
- Check for correct file directory permissions