How to update 5 to 5.0.1 via composer?

Hej guys,

I did a new installation of Mautic 5 via Composer.

Now Mautic shows an update to 5.0.1. How do I update over composer?

The documentation is missing this point so far:

https://docs.mautic.org/en/5.x/getting_started/how_to_update_mautic.html#

It’s not possible to do it over webinterface or with php bin/console mautic:update:apply

Thanks for any help

Tim

1 Like

OK I tried now composer update & upgrade and also composer install, but the version number in the webinterface still shows 5.0.0.

Hi there, we’ve just had the PRs for bumping the recommended project version approved, so should be available presently!

https://docs.mautic.org/en/5.x/getting_started/how_to_install_mautic.html#updating-mautic-core the docs are here, we probs need to separate it out into a separate section in the updating page for Composer installs. Would you be up for helping with that?

I think @mollux is also looking at doing some more docs on composer-based installs but not sure if it’s in this area.

Hi @rcheesley - Thanks for helping!

composer update mautic/core-lib --with-dependencies - was running without problems.

But when I tried this “bin/console mautic:update:apply --finish”
I get this message:

“You have Composer updates enabled. This means that you can only update Mautic through the ‘composer update’ command. Read more in the documentation: How to switch to Composer — Mautic Documentation 0.1 documentation

When running bin/console doctrine:migration:migrate --no-interaction - I go these errors:

[error] Migration Mautic\Migrations\Version20230621074925 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'point_groups' already exists"

In ExceptionConverter.php line 45:

  An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'point_groups' already exists


In Exception.php line 28:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'point_groups' already exists


In Connection.php line 71:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'point_groups' already exists


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

When running bin/console doctrine:schema:update --no-interaction --force I receive these:

mautic@services:~/public$ bin/console doctrine:schema:update --no-interaction --force


 [WARNING] Not passing the "--complete" option to "doctrine:schema:update" is deprecated and will not be supported when
           using doctrine/dbal 4


 Updating database schema...


In ExceptionConverter.php line 117:

  An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP INDEX `IDX_1AE3441319EB6921`; check that it exists


In Exception.php line 28:

  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP INDEX `IDX_1AE3441319EB6921`; check that it exists


In Connection.php line 33:

  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP INDEX `IDX_1AE3441319EB6921`; check that it exists


doctrine:schema:update [--em EM] [--complete] [--dump-sql] [-f|--force]

Besides that, I am happy to help to seperate the documentation. Haven’t done something like that before, so happy to get a little help first how to help you/do that.

There is an open GH issue for this:

Please follow the discussion and join in with new inputs.

So 5.0.2 got released, I did the same steps again:

The DB upgrade still breaks - Or am I just to early?!

mautic@services:~/public$ bin/console doctrine:migration:migrate --no-interaction
[2024-01-17 08:14:40] [notice] Migrating up to Mautic\Migrations\Versionzz20230929183000
[2024-01-17 08:14:40] [notice] Table contact_export_scheduler already exists
[2024-01-17 08:14:40] [notice] Migration Mautic\Migrations\Version20220429091934 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 08:14:41] [notice] Migration Mautic\Migrations\Version20220722074516 skipped during Pre-Checks. Reason: "The deduplicate column has already been added to the notifications table."
[2024-01-17 08:14:41] [notice] Migration Mautic\Migrations\Version20221014061125 skipped during Pre-Checks. Reason: "Index webhook_id_date_added already exists"
[2024-01-17 08:14:41] [notice] Migration Mautic\Migrations\Version20221014081742 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 08:14:41] [notice] Migration Mautic\Migrations\Version20221128145933 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 08:14:41] [notice] Migration Mautic\Migrations\Version20230131133732 skipped during Pre-Checks. Reason: "The last_built_time column has already been added to the lead_lists table."
[2024-01-17 08:14:41] [notice] Column asset_downloads.utm_campaign already exists
[2024-01-17 08:14:41] [notice] Column asset_downloads.utm_content already exists
[2024-01-17 08:14:41] [notice] Column asset_downloads.utm_medium already exists
[2024-01-17 08:14:41] [notice] Column asset_downloads.utm_source already exists
[2024-01-17 08:14:41] [notice] Column asset_downloads.utm_term already exists
[2024-01-17 08:14:41] [notice] Migration Mautic\Migrations\Version20230321133733 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 08:14:41] [notice] Migration Mautic\Migrations\Version20230424083829 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 08:14:41] [notice] Table plugin_crm_pipedrive_owners was already removed
[2024-01-17 08:14:41] [notice] Migration Mautic\Migrations\Version20230519154448 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 08:14:41] [notice] Migration is not required.
[2024-01-17 08:14:41] [notice] Migration Mautic\Migrations\Version20230606111852 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 08:14:41] [notice] Table point_groups already exists
[2024-01-17 08:14:41] [notice] Table point_group_contact_score already exists
[2024-01-17 08:14:41] [notice] Column points.group_id already exists
[2024-01-17 08:14:41] [notice] Column point_triggers.group_id already exists
[2024-01-17 08:14:41] [notice] Column lead_points_change_log.group_id already exists
[error] Migration Mautic\Migrations\Version20230621074925 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'point_groups' already exists"

In ExceptionConverter.php line 45:

  An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'point_groups' already exists


In Exception.php line 28:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'point_groups' already exists


In Connection.php line 71:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'point_groups' already exists


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

@patryk.gruszka can you take a look?

One thing to try is doing

bin/console doctrine:migrations:execute 'Mautic\Migrations\Version20230621074925' --down

And then

bin/console doctrine:migrations:execute 'Mautic\Migrations\Version20230621074925' --up
2 Likes

This should help if the migration was partially executed.

Thank you guys, I really appreciate your fast responses. I owe you something!

The queries mentioned from @escopecz worked:

mautic@services:~/public$ bin/console doctrine:migrations:execute 'Mautic\Migrations\Version20230621074925' --down

 WARNING! You are about to execute a migration in database "mautic" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
 > yes

[notice] Executing Mautic\Migrations\Version20230621074925 down
[notice] finished in 1459.7ms, used 46.5M memory, 1 migrations executed, 10 sql queries

 [OK] Successfully migrated version(s): Mautic\Migrations\Version20230621074925: [DOWN]



mautic@services:~/public$ bin/console doctrine:migrations:execute 'Mautic\Migrations\Version20230621074925' --up

 WARNING! You are about to execute a migration in database "mautic" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
 > yes

[notice] Executing Mautic\Migrations\Version20230621074925 up
[notice] finished in 2579.1ms, used 52.5M memory, 1 migrations executed, 10 sql queries

 [OK] Successfully migrated version(s): Mautic\Migrations\Version20230621074925: [UP]

But the interface still shows 5.0.0 and also offers the update to 5.0.2.
I did cleared the cache afterwards.

Afterwards I tried the whole proccess again:

mautic@services:~/public$ bin/console doctrine:migration:migrate --no-interaction
[2024-01-17 11:17:02] [notice] Migrating up to Mautic\Migrations\Versionzz20230929183000
[2024-01-17 11:17:02] [notice] Table contact_export_scheduler already exists
[2024-01-17 11:17:02] [notice] Migration Mautic\Migrations\Version20220429091934 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 11:17:02] [notice] Migration Mautic\Migrations\Version20220722074516 skipped during Pre-Checks. Reason: "The deduplicate column has already been added to the notifications table."
[2024-01-17 11:17:02] [notice] Migration Mautic\Migrations\Version20221014061125 skipped during Pre-Checks. Reason: "Index webhook_id_date_added already exists"
[2024-01-17 11:17:03] [notice] Migration Mautic\Migrations\Version20221014081742 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 11:17:03] [notice] Migration Mautic\Migrations\Version20221128145933 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 11:17:03] [notice] Migration Mautic\Migrations\Version20230131133732 skipped during Pre-Checks. Reason: "The last_built_time column has already been added to the lead_lists table."
[2024-01-17 11:17:03] [notice] Column asset_downloads.utm_campaign already exists
[2024-01-17 11:17:03] [notice] Column asset_downloads.utm_content already exists
[2024-01-17 11:17:03] [notice] Column asset_downloads.utm_medium already exists
[2024-01-17 11:17:03] [notice] Column asset_downloads.utm_source already exists
[2024-01-17 11:17:03] [notice] Column asset_downloads.utm_term already exists
[2024-01-17 11:17:03] [notice] Migration Mautic\Migrations\Version20230321133733 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 11:17:03] [notice] Migration Mautic\Migrations\Version20230424083829 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 11:17:03] [notice] Table plugin_crm_pipedrive_owners was already removed
[2024-01-17 11:17:03] [notice] Migration Mautic\Migrations\Version20230519154448 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 11:17:03] [notice] Migration is not required.
[2024-01-17 11:17:03] [notice] Migration Mautic\Migrations\Version20230606111852 skipped during Pre-Checks. Reason: "Schema includes this migration"
[2024-01-17 11:17:03] [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."
[2024-01-17 11:17:03] [notice] Migration Mautic\Migrations\Versionzz20230929183000 skipped during Pre-Checks. Reason: "There are no local config files to migrate. Skipping the migration."
[2024-01-17 11:17:03] [notice] finished in 855.9ms, used 56.5M memory, 12 migrations executed, 0 sql queries
[2024-01-17 11:17:03]
[2024-01-17 11:17:03]
[2024-01-17 11:17:03]  [OK] Successfully migrated to version: Mautic\Migrations\Versionzz20230929183000
[2024-01-17 11:17:03]
[2024-01-17 11:17:03]
[2024-01-17 11:17:03]

That looked good, than it things break again:

mautic@services:~/public$ bin/console doctrine:schema:update --no-interaction --force


 [WARNING] Not passing the "--complete" option to "doctrine:schema:update" is deprecated and will not be supported when
           using doctrine/dbal 4


 Updating database schema...


In ExceptionConverter.php line 117:

  An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP INDEX `IDX_1AE3441319EB6921`; c
  heck that it exists


In Exception.php line 28:

  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP INDEX `IDX_1AE3441319EB6921`; check that it exists


In Connection.php line 33:

  SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP INDEX `IDX_1AE3441319EB6921`; check that it exists


doctrine:schema:update [--em EM] [--complete] [--dump-sql] [-f|--force]

So, my instance is stil on 5.0.0.

I can’t tell which migration caused that issue. Please be gentle with the --force option to any command.

The command only handles migrations. Not upgrading to new versions of Mautic. Since you installed Mautic with Composer, please test these steps to update to 5.0.2 and comment if they worked for you:

Thanks @escopecz - I only used the force option as it was mentioned in the official documentation.
I followed the steps, the update went through but still even after I cleared the cache it shows 5.0.0.

I think I will just reinstall it and will not use composer for now.

Do what you must. It’d be great if you could help @mollux testing the steps for the docs in the thread I posted previously. The non-composer installations have limited features and it will continue to be discouraged.

Mattias also works on a docker compose installation if that’s what you’d like to help to test.

But I understand that if you need a working Mautic installation then manual installation is probably what you need at this point.

I tried the steps, the run without issues, but my installation still shows 5.0.0. I even deleted the browser cache and used another one for double checking. So i don’t know what else to try right now. But if you have further ideas I am happy to help you guys testing them.

Hit the bell icon on the 4.4.10 → 5.0.1 fails because Symfony Path is not fount in ParameterLoader.php - #7 by mollux thread. That way you’ll be notified once the official docs are sorted.

That here was the solution!

I also had missing repos. Thamks @escopecz for your patience and help!

1 Like

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