Updating safely to 2.15.3

Hey guys!

Very excited to install the new 2.15.3 update!

When installing both 2.15.1/2.15.2 I could never even get the install to work and I know there was an issue with the updater not executing successfully, more so in 2.15.2 and I’d love to avoid having to fresh install my Mautic instance.

What is the recommended method for updating to the newest instance? I am currently on 2.15.0 if this makes any difference.

I am fairly knowledgeable and resourceful when it comes to implementing these changes however a step by step guide if anyone has the time would be hugely appreciated to ensure the process goes as smoothly as possible.

I have access to SSH via terminal, my mautic install is in a subdomain - mautic.mysite.com - and I have a copy of the 2.15.3-update from github.

I’m guessing I patch these files into the root directory of my Mautic install and run upgrade.php?

If this is the correct method can you clarify on how to take these steps?

Many thanks for your time!

My Mautic version is: 2.15.0
My PHP version is: 7.2.22

I’m literally just about to do this for one of my instances…as soon as the database backup finishes.

My process is based on the console command mautic:update:apply:

$ cd /var/www/mautic
tmp=$(mktemp -d)
$ pushd $tmp
$ wget $(lastversion mautic/mautic --assets --filter update)
--2019-10-09 12:56:06--  https://github.com/mautic/mautic/releases/download/2.15.3/2.15.3-update.zip
Resolving github.com (github.com)... 13.236.229.21
...
2019-10-09 12:56:14 (6.41 MB/s) - ‘2.15.3-update.zip’ saved [48233907/48233907]
$ popd
$ alias console
alias console='sudo -H -u www-data php app/console -vvv'

$ console mautic:update:apply --update-package=${tmp}/2.15.3-update.zip --force

$ echo Profit!
Profit!

Virgil
:australia:

PS: lastversion is available via pip

1 Like

Generally you should be able to run

php app/console mautic:update:find

and then

php app/console mautic:update:apply

(see docs here on what to do if an update fails - it has step by step processes to follow)

however there was a problem with a webhook from Github in the last release which means that it isn’t finding the new files for 2.15.3. We’re just looking into fixing it!

2 Likes

Thank you for your detailed reply Virgil, hope the update went without issues!

As per @rcheesley’s response, I am going to wait a few days to see what the news is and go from there.

Many thanks!

The issue is now resolved, so updating should work just fine at command line!

1 Like

Hi Ruth,

Thank you for your swift reply!

If you could make it known if possible when the update webhooks are fixed and when all is confirmed to work that would be amazing!

Hope you’re well, many thanks!

1 Like

The issue is resolved, updates should be working fine - please report back if they are not. It was resolved late yesterday (Wednesday).

1 Like

Just tried updating and it failed.

First try, I used command line.
Second try, I used the update link within mautic.
Hung at “clearing application cache” which continued to say progress.

What errors do you get at command line?

No Errors from the command line. Says that the upgrade is complete, but when I then go to access the site, the browser says that mautic is offline

OK, so now, once you’ve done the upgrade, if you run the following at command line what does it say:

php app/console mautic:update:apply

Have you checked the error logs for your Mautic instance (look in app>logs and you should see one starting with mautic_prod and today’s date)?

Have you cleared the cache manually by deleting app>cache>prod?

I will have to do a fresh backup and install.
I will get back to you with the results after doing what you suggest.
Thanks for the help.

Do please check the logs, clear the cache, and follow the upgrade failed docs first before rolling back - might fix the issue! Otherwise look forward to hearing from you!

I just did a GUI update on my local instance of 2.15.2 to see if I could replicate. I see the update whirling on the cache clear stage for ages, then it goes to the database stage, and then it completes - so I think maybe it’s just a case of being patient! If I open Mautic in a new window before the cache part is completed, it is successfully updated - but there will still be database updates to process.

So I’d guess there’s a problem delaying the update in the cache removal stage - in that case, if you quit early, follow the instructions here https://www.mautic.org/docs/en/tips/update-failed.html which may help you to resolve this.

Ok guys, if you have access to SSH for your Mautic installation then simply follow this guide to update simply and effectively to the lastest instance (2.15.3) of Mautic;

https://www.mautic.org/docs/en/tips/update-failed.html

I’m aware that this is a post about how to recover from a failed update, however it contans step by step commands to execute via terminal as it seems a few people are still having issues with the online updater or database errors.

Thank you for all your help so far!

1 Like

finishing the upgrade

After running console mautic:update:apply you very much want to do a hard cache:clear by deleting the app/cache/prod directory.

$ rm -rf ./app/cache/prod
$ console cache:clear

image

$ console --version
Mautic version 2.15.3 - app/prod

That should give you a working login page (/s/login), but check the database mappings and schema.

database schema checks

migration status

$ console doctrine:migrations:status

 == Configuration

    >> Name:                                               Mautic Migrations
    >> Database Driver:                                    pdo_mysql
    >> Database Name:                                      mauticuserdb
    >> Configuration Source:                               manually configured
    >> Version Table Name:                                 migrations
    >> Version Column Name:                                version
    >> Migrations Namespace:                               Mautic\Migrations
    >> Migrations Directory:                               /var/www/mauticuser/mautic/app/migrations
    >> Previous Version:                                   2018-12-04 00:00:00 (20181204000000)
    >> Current Version:                                    2019-07-15 06:50:13 (20190715065013)
    >> Next Version:                                       Already at latest version
    >> Latest Version:                                     2019-07-15 06:50:13 (20190715065013)
    >> Executed Migrations:                                134
    >> Executed Unavailable Migrations:                    0
    >> Available Migrations:                               134
    >> New Migrations:                                     0

schema validate :white_check_mark:

$ console doctrine:schema:validate
[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.

[Mapping]  FAIL - The entity-class 'Bazinga\OAuthServerBundle\Model\AccessToken' mapping is invalid:
* The field 'Bazinga\OAuthServerBundle\Model\AccessToken#expiresAt' uses a non-existant type 'int'.

[Mapping]  FAIL - The entity-class 'Bazinga\OAuthServerBundle\Model\RequestToken' mapping is invalid:
* The field 'Bazinga\OAuthServerBundle\Model\RequestToken#expiresAt' uses a non-existant type 'int'.

[Database] FAIL - The database schema is not in sync with the current mapping file.

interpreting the results

  • known issues :bug:
    • GitHub Issue #5847

      • Mautic\DynamicContentBundle\Entity\DynamicContentLeadData
    • GitHub Issue #5848

      • The entity-class Bazinga\OAuthServerBundle\Model\AccessToken
      • The entity-class Bazinga\OAuthServerBundle\Model\RequestToken

      Submitted PR #4 to the forked repo

schema update :card_file_box:

$ console doctrine:schema:update
ATTENTION: This operation should not be executed in a production environment.
           Use the incremental update to detect changes during development and use
           the SQL DDL provided to manually update your database in production.

The Schema-Tool would execute "29" queries to update the database.
Please run the operation by passing one - or both - of the following options:
    doctrine:schema:update --force to execute the command
    doctrine:schema:update --dump-sql to dump the SQL statements to the screen
$ console doctrine:schema:update --dump-sql

Most of these updates look like the plugin MauticExtendedFieldBundle is doing it’s job.
eg: lead_fields_leads_<type>_xref

Sample SQL queries
ALTER TABLE campaign_events_timing ADD CONSTRAINT FK_3002A471F7E88B FOREIGN KEY (event_id) REFERENCES campaign_events (id) ON DELETE CASCADE;
ALTER TABLE lead_fields_leads_boolean_xref ADD CONSTRAINT FK_C0A1940855458D FOREIGN KEY (lead_id) REFERENCES leads (id) ON DELETE CASCADE;
ALTER TABLE lead_fields_leads_text_xref ADD CONSTRAINT FK_EA908229EE6485B3 FOREIGN KEY (lead_field_id) REFERENCES lead_fields (id) ON DELETE CASCADE;
ALTER TABLE lead_fields_leads_time_xref ADD CONSTRAINT FK_4053F53155458D FOREIGN KEY (lead_id) REFERENCES leads (id) ON DELETE CASCADE;
ALTER TABLE lead_fields_leads_time_xref ADD CONSTRAINT FK_4053F531EE6485B3 FOREIGN KEY (lead_field_id) REFERENCES lead_fields (id) ON DELETE CASCADE;
ALTER TABLE lead_fields_leads_string_secure_xref ADD CONSTRAINT FK_6F66100A55458D FOREIGN KEY (lead_id) REFERENCES leads (id) ON DELETE CASCADE;

Virgil
:australia:

2 Likes

Hi,
I used to update from 2.15.1 to 2.15.3 and failed.
I do not have access with SSH so I used Virgils commands.php to check the database like the recommended steps discribed in https://mauteam.org/mautic/mautic-admins/mautic-update-how-to-dont-click-that-button/

But with this I do not understand the way to upgrade to 2.15.3 over the commands.php
[mautic:update:find] notifices that there is a new release to found at github
[mautic:update:apply --no-interaction --force] takes a while, but then running the GUI will show the old release 2.15.1

So than I tried an old upgrade.php and run into the offline site.
I just restored a backup. Checking the database an schema looks fine.

At now I don´t have any idea to get this upgrade succcessfully done.
Thanks you for any idea and reply.

Rosco

@Rosco do you have access to SSH command line?
What kind of hosting are you using?

@Yosu_Cadilla

thanks for your response.
Hosting is at a ISP in Germany. I am not familiar wiht SSH command line processes.

Would migrating to a VPS be a possibility for you? There are very good quality providers in Germany that are also priced very competitively.

Hosting Mautic on shared hosting is not a very good idea:

You can install Mautic on a VPS without previous knowledge of SSH/BASH in just a few minutes using this tutorial:

And I’ll be happy to help you if you have any issues with the tutorial.

1 Like