Docker Image Ignoring db_table_prefix setting

Your software
My Mautic version is: Docker image tag 5-apache
My Database type and version is: MariaDB 10.11.4

Your problem
I’ve updated a container from Mautic V4 to V5 using the 5-apache tagged image on Docker Hub and I’m getting error in the log about tables not being found and I noticed that the table prefix is missing. I’ve checked it is in the local.php and it is:

'db_table_prefix' => 'myprefix_',

and I’ve also tried adding it as an environment variable like this:

MAUTIC_DB_TABLE_PREFIX=myprefix_

but the same errors are shown in the log after restarting the container.

This is an example of the errors that are showing in the log:

[2024-06-26T16:00:28.869346+00:00] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\TableNotFoundException: "An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.ip_addresses' doesn't exist" at /var/www/html/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 49 {"exception":"[object] (Doctrine\\DBAL\\Exception\\TableNotFoundException(code: 1146): An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.ip_addresses' doesn't exist at /var/www/html/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:49)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1146): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.ip_addresses' doesn't exist at /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.ip_addresses' doesn't exist at /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130)"} {"hostname":"fdcf5c6c813f","pid":24}

It’s multiple different tables but all are missing the prefix.

I’m also seeing this “PHP Notice” in the Docker log for the container:

[Wed Jun 26 15:59:07.969962 2024] [php:notice] [pid 24] [client 10.0.1.211:35546] PHP Deprecation - fnmatch(): Passing null to parameter #2 ($filename) of type string is deprecated - in file /var/www/html/docroot/app/middlewares/CORSMiddleware.php - at line 107

But I don’t think that is relevant to the missing table prefix, but I’ve included incase it is.

Is there something else I need to do with Mautic 5 for the prefix?

Also, is there any sort of upgrade guide for V4 to V5 with Docker? Are there other things I need to change? From reading the page on Docker Hub, there didn’t really seem to be anything that needed doing apart from changing the image.

Thanks.