# Updating safely to 2.15.3

**URL:** https://forum.mautic.org/t/updating-safely-to-2-15-3/11337
**Category:** Product Support
**Created:** [October 9, 2019, 12:18pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337 "2019-10-09T12:18:04Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![masidus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/masidus/32/878_2.png) [@masidus](https://forum.mautic.org/u/masidus)
#### Post date: [October 9, 2019, 12:18pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/1 "2019-10-09T12:18:04Z")

</div>

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](http://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

---

<div class="post-metadata">

### Author: ![virgilwashere](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/virgilwashere/32/554_2.png) [@virgilwashere](https://forum.mautic.org/u/virgilwashere)
#### Post date: [October 9, 2019, 12:57pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/2 "2019-10-09T12:57:11Z")

</div>

> [@masidus](#):
>
> I have access to SSH via terminal, my mautic install is in a subdomain - [mautic.mysite.com](http://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?

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

PS: [`lastversion`](https://github.com/dvershinin/lastversion) is available via `pip`

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [October 9, 2019, 1:01pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/3 "2019-10-09T13:01:32Z")

</div>

Generally you should be able to run

`php app/console mautic:update:find`

and then

`php app/console mautic:update:apply`

(see docs [here](https://www.mautic.org/docs/en/tips/update-failed.html) 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!

---

<div class="post-metadata">

### Author: ![masidus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/masidus/32/878_2.png) [@masidus](https://forum.mautic.org/u/masidus)
#### Post date: [October 10, 2019, 10:46am UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/4 "2019-10-10T10:46:02Z")

</div>

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

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

Many thanks!

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [October 10, 2019, 10:46am UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/5 "2019-10-10T10:46:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![masidus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/masidus/32/878_2.png) [@masidus](https://forum.mautic.org/u/masidus)
#### Post date: [October 10, 2019, 10:47am UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/6 "2019-10-10T10:47:03Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [October 10, 2019, 11:36am UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/7 "2019-10-10T11:36:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mediamix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mediamix/32/679_2.png) [@mediamix](https://forum.mautic.org/u/mediamix)
#### Post date: [October 10, 2019, 1:12pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/8 "2019-10-10T13:12:13Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [October 10, 2019, 6:12pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/9 "2019-10-10T18:12:08Z")

</div>

What errors do you get at command line?

---

<div class="post-metadata">

### Author: ![mediamix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mediamix/32/679_2.png) [@mediamix](https://forum.mautic.org/u/mediamix)
#### Post date: [October 10, 2019, 6:23pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/10 "2019-10-10T18:23:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [October 10, 2019, 6:26pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/11 "2019-10-10T18:26:35Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mediamix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mediamix/32/679_2.png) [@mediamix](https://forum.mautic.org/u/mediamix)
#### Post date: [October 10, 2019, 6:38pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/12 "2019-10-10T18:38:43Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [October 10, 2019, 6:48pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/13 "2019-10-10T18:48:39Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [October 10, 2019, 6:55pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/14 "2019-10-10T18:55:01Z")

</div>

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](https://www.mautic.org/docs/en/tips/update-failed.html) which may help you to resolve this.

---

<div class="post-metadata">

### Author: ![masidus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/masidus/32/878_2.png) [@masidus](https://forum.mautic.org/u/masidus)
#### Post date: [October 12, 2019, 7:02pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/15 "2019-10-12T19:02:16Z")

</div>

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

---

<div class="post-metadata">

### Author: ![virgilwashere](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/virgilwashere/32/554_2.png) [@virgilwashere](https://forum.mautic.org/u/virgilwashere)
#### Post date: [October 14, 2019, 1:29am UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/16 "2019-10-14T01:29:56Z")

</div>

> [@silavapi](#):
>
> Have you cleared the cache manually by deleting app\>cache\>prod?

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

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

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/79da23ece35161a6152a8c8fdfde19c669f6beb7.png)

```console
$ 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
$ 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 ✅

```console
$ 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 🐛
  - GitHub Issue [#5847](https://github.com/mautic/mautic/issues/5847)

  - GitHub Issue [#5848](https://github.com/mautic/mautic/issues/5848)

### schema update 🗃

```console
$ 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**
>
> ```sql
> 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  
🇦🇺

---

<div class="post-metadata">

### Author: ![Rosco](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rosco/32/510_2.png) [@Rosco](https://forum.mautic.org/u/Rosco)
#### Post date: [November 13, 2019, 10:42pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/17 "2019-11-13T22:42:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Yosu\_Cadilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yosu_cadilla/32/6206_2.png) [@Yosu\_Cadilla](https://forum.mautic.org/u/Yosu_Cadilla)
#### Post date: [November 14, 2019, 7:05pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/18 "2019-11-14T19:05:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Rosco](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rosco/32/510_2.png) [@Rosco](https://forum.mautic.org/u/Rosco)
#### Post date: [November 15, 2019, 3:32pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/19 "2019-11-15T15:32:12Z")

</div>

@Yosu_Cadilla

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

> [@Rosco](#):
>
> I do not have access with SSH so I used Virgils commands.php to check the database like the recommended steps discribed in [How to Successfully Update your Own Mautic Self-Hosted](https://mauteam.org/mautic/mautic-admins/mautic-update-how-to-dont-click-that-button/)

---

<div class="post-metadata">

### Author: ![Yosu\_Cadilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yosu_cadilla/32/6206_2.png) [@Yosu\_Cadilla](https://forum.mautic.org/u/Yosu_Cadilla)
#### Post date: [November 15, 2019, 5:06pm UTC](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337/20 "2019-11-15T17:06:48Z")

</div>

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:

> **[Mautic Hosting: Mautic Self Hosted Best Practices | mauteam.org](https://mauteam.org/mautic/mautic-admins/mautic-hosting-mautic-self-hosted-best-practices/)**
>
> Mautic will run on any server that supports PHP and a MySQL compatible database, which is little short of saying it will run anywhere, you could run it on Linux, Windows, you could run it on your…

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

> **[Mautic Installation in 3 Simple Steps on a VPS | mauteam.org](https://mauteam.org/mautic/mautic-admins/mautic-installation-in-3-simple-steps-on-a-vps/)**
>
> With this Mautic tutorial, you will learn how to complete the Mautic 2.15.3 installation on a Virtual Private Server (VPS) with PHP 7.2 on top of Ubuntu 18.04.

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

[Next page](https://forum.mautic.org/t/updating-safely-to-2-15-3/11337.md?page=2)
