Mautic Upgrade Issue: M6.0.3 → M7.0.1 Fails with SQL Error and 500 Internal Server Errors

Hello,

I recently attempted to upgrade my Mautic test instance from 6.0.3 to 7.0.1, but unfortunately the upgrade failed and left the system in a partially broken state. I’m posting here to see if anyone has encountered the same issue or has advice on how to resolve it.

Environment

  • Mautic version before upgrade: 6.0.3

  • Attempted upgrade to: 7.0.1

  • PHP version: 8.3.17

  • Database: MariaDB 11.4

The upgrade process fails with the following database error:

An exception occurred while executing a query:
SQLSTATE[42000]: Syntax error or access violation: 1091
Can't DROP INDEX `mtc_company_match`; check that it exists

No other migration errors are reported.

It appears that the upgrade script attempts to drop the index mtc_company_match, but the index does not exist in the database.

Behaviour After the Failed Upgrade

After the upgrade attempt, the UI is partially broken:

  • Clicking Companies results in a 500 Internal Server Error.

  • Clicking Segments also results in a 500 Internal Server Error.

  • Clicking Channels → Emails does nothing at all (no navigation, no error displayed).

Other parts of the interface still appear to load normally.

What I’ve Checked So Far

  • Cleared cache

  • Verified file permissions

  • Confirmed PHP version is compatible

Questions

  1. Has anyone else experienced this issue when upgrading from Mautic 6 → 7?

  2. Should the index mtc_company_match exist in Mautic 6.0.3, or is the migration script expecting something that may not exist in some installs?

  3. Is there a recommended way to safely recreate or bypass this index step in the migration?

When I run mautic 7.0.1 more errors are generated in the log complaining about the missing project tables etc. Therefore has the data migration actually completed successfully and how do I check ?

I do have a pre-upgrade backup if all else fails.

Any guidance would be greatly appreciated to troubleshoot the upgrade before I roll it back to 6.0.3.

Thanks!

Hello,

I’ve successfully rolled back my test instance of Mautic from M7.0.1 to M6.0.2 using backups, and the environment is now running normally again.

Unfortunately, upgrading Mautic has been a long-running challenge in my experience, and the process hasn’t worked reliably for me so far. Rather than just leaving it there, I’d really like to help identify the root cause for the benefit of the wider community.

If a developer is willing to assist, I’m happy to reinstall M7 and work through the upgrade process step-by-step to diagnose the issue properly. My goal is to understand what’s going wrong and hopefully contribute findings that could help others facing the same problem.

Thanks in advance to anyone who’s willing to collaborate on troubleshooting this as upgrades must work reliably in production - just ignoring the problem is not an option anymore.

Hello,

I have rolled back my test instance to 6.0.2 and it works as expected.
I then re-install the M7.0.1 update.

M7.0.1 does not work after the update as explained above i.e. the UI is partially broken.

I have two error messages about missing tables in the log. I have checked they don’t exist in the my test instance database.

Syntax error or access violation: 1091 Can’t DROP INDEX `mtc_company_match`; check that it exists
Base table or view not found: 1146 mtc_projects’ doesn’t exist

Should the above tables exist in the database of M7.0.1 ?

The database migration appears to be failing without an indication in the logs with the word error.

Is there any simple way to turn on Mautic debugging information so I can narrow down the problem and report back here ?

Thanks.

Hello everyone,

I just wanted to share that I’ve managed to successfully upgrade my Mautic test instance from M6.x to M7.0.1. Everything including the UI is now running on M7.0.1 without any apparent data loss or UI errors. I haven’t tested every feature just the basic UI.

It took a bit of troubleshooting and testing, but I eventually found a working approach for the upgrade process that works on my platform every time.

If anyone else is struggling with upgrading between versions, there is definitely a solution. And I did not have to remove any table prefixes either.

I’m happy to share more details if people are interested or facing similar issues if the developers won’t help.

Thanks!