# Upgrade from 4.4.13 to 5.2.6 cannot finish

**URL:** <https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [June 13, 2025, 10:05am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860 "2025-06-13T10:05:54Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimitriskr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dimitriskr/32/13367_2.png) [@dimitriskr](https://forum.mautic.org/u/dimitriskr)\
**Post date:** [June 13, 2025, 10:05am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/1 "2025-06-13T10:05:54Z")

</div>

**Your software**  
My Mautic version is: 4.4.13  
My PHP version is: PHP 8.1 (in order to support upgrade to 5.2.x - originally 7.4)  
My Database type and version is: MariaDB 10.6

**Your problem**  
I copied the instance to a separate installation in order to test the upgrade from 4.4.10 to latest 5.2. I did the upgrade to 4.4.13 (with PHP 7.4), all is well.

Running `php bin/console mautic:update:apply --finish` for the upgrade to `5.2.6` produced the following error in console

```auto
In AppKernelProdContainer.php line 11432:
                                                            
  The parameter "2BfyJlQzl1YYuwYO2ouVFYR" must be defined.  

```

These errors are showing in the log:  
`var/logs/prod-2025-06-13.php`

```auto
[2025-06-13 07:37:38] mautic.WARNING: Command `mautic:update:apply` exited with status code 1 {"hostname":"yoshi-new","pid":118857}

```

Steps I have tried to fix the problem:  
Searched everything, no luck 😮‍💨

`schema:validate` command produced the following, while on 4.4.10, and `schema:update --sql-dump` produced a lot of queries

```auto

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
--------

                                                                                                                        
 [ERROR] The database schema is not in sync with the current mapping file. 

```

I have experience in sysadmin stuff

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 13, 2025, 10:37am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/2 "2025-06-13T10:37:59Z")

</div>

This is a tricky one 🙂  
Hold on to you hat:  
You cannot upgrade because of your email system password 🙂

Your DSN (email config) has a string, which is not properly excaped. Try to remove it, upgrade and add it again 🙂

You need to remove the email password anyway, since the email config is 100% new in Mautic 5.

---

<div class="post-metadata">

**Author:** ![dimitriskr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dimitriskr/32/13367_2.png) [@dimitriskr](https://forum.mautic.org/u/dimitriskr)\
**Post date:** [June 13, 2025, 11:05am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/3 "2025-06-13T11:05:13Z")

</div>

So in my `app/config/local.php`, in all `mailer_` settings, I put empty strings, NULL, or completely remove them? Or it doesn’t matter which option?

---

<div class="post-metadata">

**Author:** ![dimitriskr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dimitriskr/32/13367_2.png) [@dimitriskr](https://forum.mautic.org/u/dimitriskr)\
**Post date:** [June 13, 2025, 11:13am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/4 "2025-06-13T11:13:40Z")

</div>

Ah it’s the `mailer_dsn` config, specifically and I removed it.

The update has moved, but produced another error! At least we’re getting there, step by step.

Database log

```auto
[ERROR] InnoDB: In ALTER TABLE `mautic`.`ma_emails` has or is referenced in foreign key constraints which are not compatible with the new table definition.

```

Database has a prefix `ma_`

---

<div class="post-metadata">

**Author:** ![dimitriskr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dimitriskr/32/13367_2.png) [@dimitriskr](https://forum.mautic.org/u/dimitriskr)\
**Post date:** [June 13, 2025, 11:35am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/5 "2025-06-13T11:35:23Z")

</div>

I’ll get back on this. I was doing some weird stuff before, trying to fix the schema, so I’ll recreate and re-import the database so it’s clear

---

<div class="post-metadata">

**Author:** ![dimitriskr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dimitriskr/32/13367_2.png) [@dimitriskr](https://forum.mautic.org/u/dimitriskr)\
**Post date:** [June 14, 2025, 8:07am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/6 "2025-06-14T08:07:57Z")

</div>

Any idea on this one?

I think it’s when this migration ran `app/migrations/Version20201026101117.php`, especially the `$this->convertEmailsEmojies();` method in its `postUp()`

```auto
console.CRITICAL: Error thrown while running command "doctrine:migrations:migrate --quiet --no-interaction". Message: "An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'm0_.preheader_text' in 'SELECT'"

```

```auto
$ php bin/console mautic:update:apply --finish
Step 1 [>---------------------------] Migrating database schema...

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

```

---

<div class="post-metadata">

**Author:** ![dimitriskr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dimitriskr/32/13367_2.png) [@dimitriskr](https://forum.mautic.org/u/dimitriskr)\
**Post date:** [June 15, 2025, 8:54am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/7 "2025-06-15T08:54:08Z")

</div>

There are some migrations that are skipped, but still reported as “New” in `doctrine:migration:status`. Do I have to manually run them, see what’s the problem?

```auto
[notice] Migrating up to Mautic\Migrations\Versionzz20230929183000
[notice] Migration Mautic\Migrations\Version20201026101117 skipped during Pre-Checks. Reason: "Schema includes this migration"
[notice] Migration Mautic\Migrations\Version20221128145933 skipped during Pre-Checks. Reason: "Schema includes this migration"
[notice] Table ma_plugin_citrix_events already exists
[notice] Migration Mautic\Migrations\Version20230522141144 skipped during Pre-Checks. Reason: "Schema includes this migration"
[notice] Migration is not required.
[notice] Migration Mautic\Migrations\Version20230606111852 skipped during Pre-Checks. Reason: "Schema includes this migration"
[notice] Migration Mautic\Migrations\Version20230627140512 skipped during Pre-Checks. Reason: "The deprecated %kernel.root_dir% is unused. Your local.php file is just fine. Skipping the migration."

```

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [June 15, 2025, 1:52pm UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/8 "2025-06-15T13:52:04Z")

</div>

I’m almost sure, that database prefixes will be ignored when migrations are applied. I had one client instance with a similar issue, where I removed the database prefix and this solved the issue.

@escopecz … in regards to migrations, do you know if database table prefixes will be respected?

---

<div class="post-metadata">

**Author:** ![dimitriskr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dimitriskr/32/13367_2.png) [@dimitriskr](https://forum.mautic.org/u/dimitriskr)\
**Post date:** [June 16, 2025, 7:43am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/9 "2025-06-16T07:43:44Z")

</div>

> [@dirk\_s](#):
>
> I’m almost sure, that database prefixes will be ignored when migrations are applied. I had one client instance with a similar issue, where I removed the database prefix and this solved the issue.

That doesn’t respect the purpose of the database prefix though.. (Even I don’t know why we added it in our installation to be honest, but still)

Did you remove the prefix only from the config or from the tables too? (I’m guessing both)

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [June 16, 2025, 10:15am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/10 "2025-06-16T10:15:23Z")

</div>

@dirk_s yes, migrations also consider the table prefix. If there is a migration that does not then it is a bug. You can review all migrations in the `app/migration` folder and for example here you can see the tables are prefixed:

> <https://github.com/mautic/mautic/blob/3efb6d3304444561924eae686f8b6bb929098c18/app/migrations/Version20200415135706.php>

The idea of table prefixes were taken from the CMS Joomla! It allowed users to host multiple Mautic instances in 1 database to save costs. As that is a limitation of some web hostings. I don’t think it adds any value nowadays when web hostings aren’t recommended for Mautic anymore for various reasons. So I thing everyone is able to create multiple databases for each Mautic instance. It’d be great to drop the prefix one day and simplify the code.

---

<div class="post-metadata">

**Author:** ![dimitriskr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dimitriskr/32/13367_2.png) [@dimitriskr](https://forum.mautic.org/u/dimitriskr)\
**Post date:** [June 16, 2025, 11:21am UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/11 "2025-06-16T11:21:43Z")

</div>

I agree on the prefix removal. Or at least let the sql driver handle it so when you run  
`$schema->getTable('xxx')` and a prefix is configured, it would automatically get the `ma_xxx` table. I think this is how Drupal does it, when you use its Database API.

Moving on to more issues of the upgrade

> [@504 Gateway Timeout when login into mautic](https://forum.mautic.org/t/504-gateway-timeout-when-login-into-mautic/25513/7):
>
> Hello, I have a similar issue after upgrading to [5.2.6 from 4.4.13](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860) My user works fine, but 2 of my colleagues that tried encountered the following: after login, the dashboards page returns 504 timeout Going to /s/config or whatever still returns 504 timeout After any page is loaded after some time, you can easily browse through the app. After a while, you get again 504 timeouts Repeat 3. Same amount of data (dashboard) in mautic v4 works fine.

For this topic scope, I only have the following yet to be answered

> [@Upgrade from 4.4.13 to 5.2.6 cannot finish](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/7):
>
> There are some migrations that are skipped, but still reported as “New” in doctrine:migration:status. Do I have to manually run them, see what’s the problem? [notice] Migrating up to Mautic\Migrations\Versionzz20230929183000 [notice] Migration Mautic\Migrations\Version20201026101117 skipped during Pre-Checks. Reason: "Schema includes this migration" [notice] Migration Mautic\Migrations\Version20221128145933 skipped during Pre-Checks. Reason: "Schema includes this migration" [notice] Table ma\_pl…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [June 17, 2025, 11:21pm UTC](https://forum.mautic.org/t/upgrade-from-4-4-13-to-5-2-6-cannot-finish/35860/12 "2025-06-17T23:21:54Z")

</div>

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