Sometimes when updating Mautic, the process might stall or fail part way through. This can cause a problem, because it can cause Mautic to be in-between two versions and often this can make the system unusable.
Generally speaking, updates fail in this way because the hosting environment is inadequately resourced. Consider moving to a Virtual Private Server (VPS) or Dedicated Server if you are using shared hosting. Read more in the installing and updating Mautic sections.
The following processes enables the completion of a failed upgrade.
Before you commence these steps, please ensure that you have a tested backup of your Mautic instance where possible.
Mautic has a built-in tool which enables you to verify the database and identify if there are any schema updates required. Visit example.com/s/update/schema
to see if there are any updates required.
If this isn't possible, or your Mautic instance is down completely, follow the next tips.
If you don't have SSH access, skip down to 'I don't have SSH access'.
Having SSH access to your server makes things much easier. Log in via command line, and change directory to the Mautic directory using the command
cd /your/mautic/directory
When an upgrade attempt fails in the final step, it may be only the outdated cache that's causing a problem. Use the following command to clear it manually:
php bin/console cache:clear
If this command throws a PHP error, you can try to remove the cache folder using the following command - be careful, this removes all files and folders in the path specified, so ensure you type it correctly, and in the correct directory.
rm -rf var/cache
If clearing the cache hasn't resolved your problems, continue with the next step.
The first step is to determine if there are any updates available using the following command:
php bin/console mautic:update:find
The output from this command informs you if there are any updates to apply. If there are, run the following command to apply them:
php bin/console mautic:update:apply
If there are no updates found, proceed to the next step.
Run the following command to identify any outstanding database migrations:
php bin/console doctrine:migration:status
If there are any reported, firstly ensure that you have a tested backup of your database before proceeding, as this command causes changes to the database, then run:
php bin/console doctrine:migration:migrate
This step requires some manual intervention - there is no command for this part.
To update the files manually, you have to:
There is a PHP script which can do almost all steps from the section preceding. You can find this script in this Gist.
The description about how to use the script is provided below the script itself. There are some details you need to do differently, so please read these instructions carefully. For example, you must use FTP to upload and download the files. You must unzip the files on your local computer and upload those files, which takes a lot longer.
Firstly, read the error message which usually gives good indications to the problem. Next, search for the error in your preferred search engine. You can also search the Mautic Forums to see if others have reported and resolved the same problem.
This error is reported as:
PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 10924085 bytes) in ...
This means that the memory limit that Apache has available is too low. Edit the memory_limit in the php.ini configuration file. Read more about working with resource limits.
Fatal: Class 'ZipArchive' not found
This means that PHP can't work with Zip packages - changes are needed to your server configuration to allow unzipping of files at the command line. Ask your hosting provider, or search for a tutorial to help with this.
If you need help, there are several places you can go to ask for assistance. Remember that most people who use the Community Forums, Chat, and GitHub are volunteers.
If you think your configuration is causing the problem, ask on the Mautic Community Forums. Search before you post, as it's likely someone might have already answered your question in the past.
You can also chat with someone in the live Community Chat however all support requests must be posted on the forums. Post there first, then drop the link to the post in Slack if you are discussing it with someone.
In all cases, it is important that you describe the problem, and all steps you have followed to resolve the problem, in detail. At a minimum, include the following:
var/logs
folder and in the server log. The server logs are located in different places depending on your setup. Ubuntu servers generally store their logs in /var/log/apache2/error.log
. Sometimes your hosting provider might offer a GUI to view logs in your Control Panel.If you don't provide this information as a minimum, the person who might try to help you has to ask you for it, so please save them the trouble and provide the information upfront. Also, importantly, please be polite. Mautic is an Open Source project, and people are giving their free time to help you.
You can also chat with someone in the live Community Chat however all support requests must go on the forums. Post there first, then drop the link to the post in Slack if you are discussing it with someone.
Found errors? Think you can improve this documentation? edit this page