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
yes
# 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

Thank you very much for this! Is all still going smooth with running Mautic inside Docker?

Would this same methodology apply to all v4 upgrades (and even v5) within Docker? I suppose with v5 it’d probably be best to export all databases from v4 and such and import into a new v5 Docker image?

Hey @Warren , I was wondering if you got the chance to do the upgrade v4 to v5. I also run on Docker and I’d like to anticipate any potential hiccups when moving to v5.

Thanks!

I mentioned upgrade to v5 via docker in standalone topic here: Upgrade Mautic from v2.16.3 to v5.0.3 via docker