Doctrine Errors while updating 4.4.13 to 5.2.7 Composer Based

Your software
My Mautic version is: 4.4.13 > 5.2.7
My PHP version is: 8.3
My Database type and version is: MySQL

Your problem
My problem is:

When I run php bin/console doctrine:migrations:migrate I get this error:

[notice] Migrating up to Mautic\Migrations\Versionzz20230929183000
[error] Migration Mautic\Migrations\Version020230615115326 failed during Execution. Error: “An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘mauticdb.vmdynamic_content’ doesn’t exist”

In ExceptionConverter.php line 49:

An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘mauticdb.vmdynamic_content’ doesn’t exist

In Exception.php line 28:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘mauticdb.vmdynamic_content’ doesn’t exist

In Connection.php line 71:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘mauticdb.vmdynamic_content’ doesn’t exist

So I ran php bin/console doctrine:schema:validate and got this information:

Mapping

[FAIL] The entity-class Mautic\DynamicContentBundle\Entity\DynamicContentLeadData mapping is invalid:

  • The association Mautic\DynamicContentBundle\Entity\DynamicContentLeadData#dynamicContent refers to the inverse side field Mautic\DynamicContentBundle\Entity\DynamicContent#id which is not defined as association.
  • The association Mautic\DynamicContentBundle\Entity\DynamicContentLeadData#dynamicContent refers to the inverse side field Mautic\DynamicContentBundle\Entity\DynamicContent#id which does not exist.

Database

In Exception.php line 115:

Unknown column type “json_array” requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \D
octrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database introspection then you might have forgotten to register all database types for a Doctrine Type. Use AbstractPla
tform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapp
ing information.

These errors are showing in the log: see above

Steps I have tried to fix the problem:

I found this post ( Mautic 5 Migration Issue – Internal Server Error & Failed Database Migration ) but I’m not entirely certain it applies to me, and found the advice difficult to follow since I don’t often work with databases directly

Alright I was able to figure this out, thanks to Perplexity. I stepped through 5.0.4 and 5.1.0 before going to 5.2.7 (and then 6.0.3). There were several problems with database migrations related to the json_array issue, old charactersets, old collations, and missing tables for dynamic content, plus one problem with a row being treated as an array.

Honestly, I have no idea why the migration itself couldn’t handle these errors or why there is no documentation available on any problems that might come up. It’s been incredibly frustrating, sucked literal weeks from my life, and hasn’t gone at all to plan, but I’ve got it updated and running again now. Yay!

Thankfully I started with a test system and didn’t attempt any of that live before documenting my steps. I’ll gladly share my knowledge with anyone else who’s having similar issues.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.