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 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.
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.
After running console mautic:update:apply you very much want to do a hardcache:clear by deleting the app/cache/prod directory.
$ rm -rf ./app/cache/prod
$ console cache:clear
$ 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
$ console doctrine:migrations:status
>> 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
$ 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.
$ 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.
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;
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.