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.
The following processes can be followed to complete the upgrade manually.
Before you commence these steps, please ensure that you have a tested backup of your Mautic instance
Mautic has a built-in tool which enables you to check the database and identify if there are any schema updates required. Visit your-mautic-url/s/update/schema to see if there are any updates required.
If this is not 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'](#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 location where Mautic is installed using the command
When an upgrade attempt fails in the final step, it may be only the outdated cache that is 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!)
rm -rf bin/cache
If clearing the cache has not resolved your problems, continue with the next step.
The first step is to find out if there are any updates available using the following command:
php bin/console mautic:update:find
The output from this command will tell 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 check for 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 will cause 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 will have to:
There is a PHP script which can do almost all steps from the section above. You can find this script in this Gist.
The description about how to use the script can be found below the script itself. There are some details you will need to do differently, so please read these instructions carefully. For example, you will need to use FTP to upload and download the files. You will have to unzip the files on your local computer and upload those files, which will take a lot longer.
The best thing to do is read the error, and 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 will usually be 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.
Fatal: Class 'ZipArchive' not found
This means that PHP cannot work with Zip packages - changes need to be made 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 are stuck and 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 is likely someone might have already answered your question in the past.
You can also chat with someone in the live Community Chat.
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:
If you don't provide the information above as a minimum, the person who might try to help you will have 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.
If you are sure that you have discovered a bug and you want to report it to developers, you can do so on Github
Found errors? Think you can improve this documentation? edit this page on Github