Issues with migration after updating from 4.4 to 5.0.2

Your software
My Mautic version is: 5.0.2
My PHP version is: 8.0
My Database type and version is: MariaDB

Your problem
I managed to install the update through composer which very badly documented in my opinion.

My issue is that once i am opening the site, the dashboard keeps loading and loading. So i wanted to do the following step by running

php bin/console doctrine:migration:migrate --no-interaction

When i do that i get the following errors:

root@marketing /var/www/mautic # php bin/console doctrine:migration:migrate --no-interaction
[2024-02-02 09:40:50] 
[2024-02-02 09:40:50]                                                                                                                         
[2024-02-02 09:40:50]  [WARNING] You have 47 previously executed migrations in the database that are not registered migrations.               
[2024-02-02 09:40:50]                                                                                                                         
[2024-02-02 09:40:50] 
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:01 (20180508202930)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:01 (20180702014364)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:01 (20180702014365)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20180821144204)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20180921144421)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:47 (20181111095447)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20190704154940)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20190724110039)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:03 (20191017140848)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:48 (20191126093923)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:04 (20191206113956)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:48 (20191219155630)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:49 (20200211095409)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:58 (20200212141530)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:58 (20200220172041)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:59 (20200227110431)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:59 (20200302164801)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20200331160919)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:03 (20200409102100)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:59 (20200422144300)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:03 (20200507122854)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:03 (20200729170800)
[2024-02-02 09:40:50]  >> 2020-09-14 11:26:53 (20200805185714)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:00 (20200810153131)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20200812180900)
[2024-02-02 09:40:50]  >> 2020-09-14 11:26:53 (20200815153711)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20200924080139)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:04 (20201015084627)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20201102120710)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20201102133546)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20201105120328)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:02 (20201120122846)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20201123070813)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20201125155904)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:04 (20201130201631)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20201207114926)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:04 (20201207140911)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20201228041109)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20210104171005)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20210203143600)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:05 (20210223174702)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:05 (20210502162314)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:08 (20210520100503)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:09 (20210609191822)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:09 (20210614151138)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:09 (20210623071326)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:09 (20220111202917)
[2024-02-02 09:40:50] [notice] Migrating up to Mautic\Migrations\Versionzz20230929183000
[error] Migration Mautic\Migrations\Version020230615115326 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `emails.headers` failed for `mautic`.`emails`"

In ExceptionConverter.php line 117:
                                                                                                                                                                 
  An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `emails.headers` failed for `mautic`.`emails`  
                                                                                                                                                                 

In Exception.php line 28:
                                                                                                                  
  SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `emails.headers` failed for `mautic`.`emails`  
                                                                                                                  

In Connection.php line 71:
                                                                                                                  
  SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `emails.headers` failed for `mautic`.`emails`  
                                                                                                                  

doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--] [<version>]

I assume that the above issue might also be the reason my site does not load correctly?

Any ideas how i can solve this issue?

Same issue. Watching.

Any ideas @anyone ?

This happened to me too. Could not find any solution elsewhere.