Skip to content

Upgrade from Mautic 3.x to Mautic 4.4.10

It is not yet time to migrate to Mautic 5 for your production environment, it is still too soon!
Mautic 4 on the other hand is currently very mature. This is the most stable, efficient and secure Mautic version we had in a very long time, especially after the recent release of Mautic 4.4.10, which is the last release in the Mautic 4.x series.
If you haven’t yet updated your Mautic 3 to Mautic 4, now is the time, here’s a guide to do so, how to upgrade to Mautic 4 in 3 simple steps.

This tutorial is built for and tested with Ubuntu 20.04, if you have a different Linux distribution or a different version of Ubuntu, some commands might be slightly different on your server or VPS.

Step 1: Migrate from Mautic 3.x to Mautic 3.3.5

First we need to migrate our M3 Mautic instance to the latest Mautic 3 version, that is: Mautic 3.3.5.

Let’s make sure you are root
sudo su

Let’s start safely by forcing proper permissions and clearing the cache
find /var/www/html -type d -exec chmod 755 -- {} +; find /var/www/html -type f -exec chmod 644 -- {} +; chown -R www-data:www-data /var/www/html

sudo -u www-data php /var/www/html/bin/console cache:clear

Let’s make sure your schema is updated:
php /var/www/html/bin/console doctrine:migration:migrate
php /var/www/html/bin/console doctrine:schema:update --force

What version are we suggested to upgrade to?
sudo -u www-data php /var/www/html/bin/console mautic:update:find

It should return something like:

Version 3.3.5 of Mautic is available for download. Please visit for more information.
To update, you can run:
sudo -u www-data php /var/www/html/bin/console mautic:update:apply

It will ask you:
Are you sure you wish to update Mautic to the latest version?
Type “y” and press enter.

The process will start

Step 5 [—–>———————-] Clearing the cache

Now we need to do a second pass to “finish” the upgrade to M3.3.5:
sudo -u www-data php /var/www/html/bin/console mautic:update:apply --finish

Step 3 [============================] Success! You are now running version 3.3.5 of Mautic.

You can now browse your Mautic instance and it should be upgraded to Mautic 3.3.5

Anyhow, we are going to run the schema updater once more…

php /var/www/html/app/console doctrine:schema:update --force

The upgrade to the latest version of Mautic 3 is now complete.

Now we can start with the M3 to M4 Upgrade:

Step 2: Prepare for the Mautic 4 requirements.

We now need to prepare your server so it meets the Mautic 4 requirements.
Let’s first check your database version is MariaDB 10.3 or newer.
systemctl status mariadb

You should get a response similar to this:
● mariadb.service – MariaDB 10.3.38 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2023-05-13 19:12:04 UTC; 1 day 3h ago

If it is 10.3.x or newer you are good to go.

You’re gonna need a newer PHP version, let’s upgrade to PHP 8.0!
apt install libapache2-mod-php8.0 php8.0 php8.0-xml php8.0-mysql php8.0-imap php8.0-zip php8.0-intl php8.0-curl php8.0-gd php8.0-mbstring php8.0-bcmath -y

And now we need to disable the old PHP 7.4 or 7.3 that you are currently running
a2dismod php7.3
a2dismod php7.4

And we also enable the newly installed PHP 8.0
a2enmod php8.0

Let’s make sure your CLI also has the proper version of PHP:
update-alternatives --set php /usr/bin/php8.0

Great, let’s make sure we did it right
pvp -v

Should return

PHP 8.0.28 (cli) (built: Feb 14 2023 18:32:57) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.28, Copyright (c) Zend Technologies
with Zend OPcache v8.0.28, Copyright (c), by Zend Technologies

And the last task is to restart the Apache server so the changes take effect
service apache2 restart

Step 3: Migrate from M3.3.5 to Mautic 4.8.8

Eager to migrate to M4? We are ready to rumble!

sudo -u www-data php /var/www/html/bin/console mautic:update:find

sudo -u www-data php /var/www/html/bin/console mautic:update:apply

sudo -u www-data php /var/www/html/bin/console mautic:update:apply --finish

That’s it, your Mautic should now be version 4.4.8

Yosu Cadilla

My name is Yosu Cadilla, a Systems Administrator since year 2000. I discovered Mautic on 2017 and since,
I’ve specialized in running Mautic for Marketing agencies and other large Mautic deployments.
Currently, I run a very specialized and fine-tuned cluster of Mautic-optimized servers.
If you are planning on deploying Mautic on a large scale, let’s have a chat!

Thank you for reading this article, I hope you found it useful. If you have questions or comments, share them on the comments section below. I do my best to reply to every single comment.