Error while updating from 4.4.11 to 5.0.3 (No Composer)

Your software
My PHP version is : PHP 8.0.30 (cli)
My MySQL/MariaDB version is : er 15.1 Distrib 10.6.16-MariaDB

Updating/Installing Errors
I am Updating from Mautic 4.4.11 to 5.0.3

Upgrading/installing via (delete as applicable) : Web / Command Line
Im not using composer and I tried the upgrade from the Command Line

These errors are showing in the installer :

fabio@marketing-staging:/srv/mautic-4.4.11$ php bin/console mautic:update:find
Version 5.0.3 of Mautic is available for download. Please visit https://github.com/mautic/mautic/releases/tag/5.0.3 for more information.
To update, you can run 'php bin/console mautic:update:apply' from the command line.

fabio@marketing-staging:/srv/mautic-4.4.11$ php bin/console mautic:update:apply
Are you sure you wish to update Mautic to the latest version? yes
Step    7 [------->--------------------] Clearing the cache

<warning>IMPORTANT: Run the same command again with --finish. For example 'php bin/console mautic:update:apply --finish'</warning>

fabio@marketing-staging:/srv/mautic-4.4.11$ php bin/console mautic:update:apply --finish
Step    1 [>---------------------------] Migrating database schema...

An error occurred while updating the database. Check log for more details.

fabio@marketing-staging:/srv/mautic-4.4.11$

These errors are showing in the Mautic log :
Here is what I can see on/srv/mautic-4.4.11/var/logs/prod-2024-02-09.php

[2024-02-09T02:45:21.263939+00:00] console.CRITICAL: Error thrown while running command "doctrine:migrations:migrate --quiet --no-interaction". Message: "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 \Doctrine\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 AbstractPlatform#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 mapping information." {"exception":"[object] (Doctrine\\DBAL\\Exception(code: 0): 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 \\Doctrine\\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 AbstractPlatform#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 mapping information. at /srv/mautic-4.4.11/vendor/doctrine/dbal/src/Exception.php:115)","command":"doctrine:migrations:migrate --quiet --no-interaction","message":"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 \\Doctrine\\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 AbstractPlatform#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 mapping information."} {"hostname":"marketing-staging","pid":2646030}

If I understand correctly, there is an error on the DB, so does this mean that we cannot upgrade from 4.x because of the DB?
Is there a way to fix this?

check if there is any differences in the composer versions between v4 and v5. sounds like you may need to bump the doctrine/Dbal version

I’m facing the same issue as carlos, how can we bump the version? Doesn’t the Mautic updater handles the updating of the doctrine version?

Hi,
I’m running he following software version on the server:

  • PHP 8.0.30
  • mysql Ver 15.1 Distrib 10.6.16-MariaDB
  • nginx version: nginx/1.18.0

Those versions are supported for Mautic 5 based on the documentation.
To what version should I update any of the software in order to try the update again?

Thanks.

@rcheesley will correct me if I am wrong or get the right person to respond.

From memory the update command only updates the core Mautic files.

This is highly dependant on how you manage your mautic instance! we manage our ourselves hence the difference.

we first check the difference in the composer files and make any necessary changes.
we then run the update command
we then run the migration command, (this sometimes takes a couple of attempts)
we then put back our custom code where needed.

I don’t suggest you do this unless you have dev experience to troubleshoot issues.

Having the same issue. Not using composer, just the CLI. Were you able to fix it, carlosatfongo?

Unfortunately not. We are probably going to rebuild our Mautic instance on a fresh M5 install in September or something. Because the work seemingly needed to update it is quite complex for our team at this time. We are theorizing it will take less work on a new installation.

Turns out, my problems stemmed from not having NPM and NVM installed on my shared hosting before updating. Once I did that, the update completed correctly.