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