Update Mautic Docker from v3 to v4

Hello, here is a quick guide for upgrading Mautic from v3 to v4 when running on docker.

  1. First stop your mautic containers
$ docker-compose down
  1. change the image tag on your docker-compose.yml and start your containers again
$ docker-compose up -d
  1. Enter into the Mautic container and execute the update commands
$ docker exec -it mautic bash                      #going into the mautic container
# php bin/console mautic:update:find               #checking for updates
# php bin/console mautic:update:apply              #executing updates
# php bin/console mautic:update:apply --finish     #finishing updates
  1. In my case I got an error

An error occurred while updating the database. Check log for more details.

but I just executed again

# php bin/console mautic:update:apply --finish

and we get the following message

“Success! You are now running version 4.4.9 of Mautic.”

You can now exit the container by typing exit

However, going to the mautic webpage, we see error 500…

  1. Let’s fix it by restarting our containers:
$ docker-compose down
$ docker-compose up -d

and now “Success! You are now running version 4.4.9 of Mautic.” (this time for real)

You can verify the version you are running by going into the dashboard bottom right corner

1 Like