Your software
My Mautic version is: 5.2.0
My PHP version is: 8.2.30
My Database type and version is: MariaDB 10.6.25
I installed Mautic via: Composer
Your problem
I would like to do a clean install of v7 but use my existing database of contacts and mailings (and of course do any needed table updates). Or would it be better to do a total new install, and then copy contact data into the tables? What would be the best way to do the install? I had v4 and did an update to v5 via Composer but the CSS is wonky and I don’t trust that the install is all good, so I don’t want to just upgrade the code.
BTW, I find the Mautic install so so extremely user unfriendly. It may be no sweat if you are very used to using the command line and composer, but it seems very archaic when everything else in the world today updates by clicking a button or even does so automatically. I can’t help but think that this has a huge impact on its popularity and adoption. I have a lot of experience programming, but I want to spend my time sending email to customers and not fiddling around the command line, when all this nitty-gritty stuff could be triggered to happen in the background behind a user-friendly UI. No disrespect meant to the project and all the work put into it, and its overall great functionality and feature set, and the fact that I don’t have to pay Mailchimp a huge amount every month!
Do a clean install of v7 and import data from old db.
Hi,
Are you suggesting manually exporting and importing all the information from old version to the new version? I have just installed mautic v7 (previously running under v5) and the new database schema was created, but data was not transfered). It would be very tedious to export/import all contacts, segments, emails, tags, etc. manually. There must have been some automated process to do this. Even a command line would work for me. At least… something…
I did this months ago, but I believe what I did was do a new install of v7, swapped in the old db, and then ran:
php bin/console cache:clear
php bin/console mautic:update:find
php bin/console mautic:update:apply
php bin/console mautic:update:apply --finish
I believe that it is:
php bin/console mautic:update:apply --finish
that updates the db schema.
Hi Adam
You should not create a completely new Mautic 7 database and then manually copy contacts, emails, segments, tags and campaigns into it. The database schema and application code must be upgraded together.
The safer migration process is:
- Make a complete backup of the existing files and database.
- Create a separate staging copy of both.
- Check PHP compatibility before each upgrade step. Different Mautic versions support different PHP versions:
- Mautic 5.2 — PHP 8.1–8.3
- Mautic 6.0 — PHP 8.1–8.3
- Mautic 7.2 — PHP 8.2–8.5
For a migration from 5 → 6 → 7, PHP 8.3 is the safest common version. After successfully reaching Mautic 7, you can separately move to PHP 8.4 or 8.5 after checking your plugins and extensions.
4. Deploy the Mautic 7 codebase or Composer project, but do not run the installer against an empty database.
5. Configure the new codebase to use the restored copy of the existing database.
6. Copy the required configuration, plugins, themes and media files.
7. Run the upgrade process from the Mautic directory, following the instructions for the target version:
php bin/console cache:clear
php bin/console mautic:update:find
php bin/console mautic:update:apply
php bin/console mautic:update:apply --finish
Run the commands on a copy first and check the migration output and logs. Do not run two Mautic versions against the same live database at the same time.
If a direct upgrade from your current 5.2 installation to Mautic 7 is not accepted by the release instructions or fails during migration, perform it in stages using the latest available 5.2 release, then Mautic 6, and finally Mautic 7.2.1. Test the instance after each major-version step.
If you have already created an empty Mautic 7 database, do not merge it table-by-table with the old database. Restore the old database into a separate staging database, point the new codebase to it, and let Mautic run its own schema migrations.
Mautic’s documentation treats the database and codebase as separate parts when changing the installation structure, and the official update process uses Composer plus the database migration commands. See: