# Manual upgrade fails

**URL:** https://meta.discourse.org/t/manual-upgrade-fails/139277
**Category:** Self-hosting
**Created:** [January 21, 2020, 10:00am UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277 "2020-01-21T10:00:13Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![tereensio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tereensio/32/167127_2.png) [@tereensio](https://meta.discourse.org/u/tereensio)
#### Post date: [January 21, 2020, 10:00am UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/1 "2020-01-21T10:00:13Z")

</div>

Hi

– trying to manually update old Discourse by these instructions

> [@Manually update Discourse and Docker image to latest](https://meta.discourse.org/t/how-do-i-manually-update-discourse-and-docker-image-to-latest/23325):
>
> bookmark This guide provides step-by-step instructions for manually updating Discourse, the Docker container, and the Ubuntu operating system on a self-hosted setup. person_raising_hand Required user level: System Administrator warning SSH access to the server. If you self-host Discourse, you occasionally need to run a manual update via the command line to get the latest security releases and newest libraries. These updates are not picked up in admin/upgrade, which is why you’ll occa…

Keep getting this error:

> Pups::ExecError: apt-get update && apt-get install -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 failed with return #\<Process::Status: pid 18 exit 100\>
> 
> Location of failure: /pups/lib/pups/exec\_command.rb:112:in `spawn’
> 
> exec failed with the params “apt-get update && apt-get install -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3”
> 
> a2bd7274278e546582a98ef46371b18564f416c2cadaa46a6ec6c58a5a3f162f
> 
> \*\* FAILED TO BOOTSTRAP \*\* please scroll up and look for earlier error messages, there may be more than one.
> 
> ./discourse-doctor may help diagnose the problem.

I upgraded to Ubuntu 18.04.3 LTS and added disk size well above double the db size.

Any ideas?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [January 21, 2020, 10:59am UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/2 "2020-01-21T10:59:31Z")

</div>

> [@tereensio](#):
>
> postgresql-9.3

😱 😱 How old is your Discourse install? On what version are you?

---

<div class="post-metadata">

### Author: ![tereensio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tereensio/32/167127_2.png) [@tereensio](https://meta.discourse.org/u/tereensio)
#### Post date: [January 21, 2020, 11:21am UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/3 "2020-01-21T11:21:00Z")

</div>

seems to be [v1.9.0.beta17 +38]

---

<div class="post-metadata">

### Author: ![JimPas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimpas/32/148179_2.png) [@JimPas](https://meta.discourse.org/u/JimPas)
#### Post date: [January 23, 2020, 5:59am UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/4 "2020-01-23T05:59:17Z")

</div>

Time for an upgrade. Discourse is up to v2.4.0.beta10.  
There have been a lot of changes, updates, improvements, etc. 😉

---

<div class="post-metadata">

### Author: ![Remah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/remah/32/70590_2.png) [@Remah](https://meta.discourse.org/u/Remah)
#### Post date: [January 23, 2020, 7:50am UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/5 "2020-01-23T07:50:57Z")

</div>

Have you got it working?

I have no expertise in this area but it looks like it is failing when trying to get Postgres 9.3.

But that was upgraded to 9.5 back in 2016 and you are using Discourse version 1.9 which is from 2018?

> [@Something seems to have gone wrong with my update](https://meta.discourse.org/t/something-seems-to-have-gone-wrong-with-my-update/55952/13):
>
> We updated our docker image to Postgres 9.5 back in May 2016 [https://meta.discourse.org/t/discourse-docker-image-version-1-3-3-released/44778](https://meta.discourse.org/t/discourse-docker-image-version-1-3-3-released/44778)

Maybe it is related to this issue:

> [@Trouble upgrading PostgreSQL from 9.3 to current](https://meta.discourse.org/t/trouble-upgrading-postgresql-from-9-3-to-current/49207):
>
> Continuing the discussion from [Discourse Docker Image version 1.3.3, released](https://meta.discourse.org/t/discourse-docker-image-version-1-3-3-released/44778): So, I have been using postgres 9.3 since the new docker image came out… and just replacing templates/postgres.9.3.template.yml with templates/postgres.template.yml doesn’t work. Given a current backup, what’s a good way to upgrade the postgres template?

Right now I don’t have time to read these topics. I just noticed no help for 2 days.

---

<div class="post-metadata">

### Author: ![tereensio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tereensio/32/167127_2.png) [@tereensio](https://meta.discourse.org/u/tereensio)
#### Post date: [January 23, 2020, 8:19am UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/6 "2020-01-23T08:19:54Z")

</div>

> Time for an upgrade. Discourse is up to v2.4.0.beta10.  
> There have been a lot of changes, updates, improvements, etc. 😉

Yes. I’m trying to upgrade. The problem is that the upgrade fails.

In just want an up-to-date Discourse, with the old stuff preserved.

How to do that?

---

<div class="post-metadata">

### Author: ![Remah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/remah/32/70590_2.png) [@Remah](https://meta.discourse.org/u/Remah)
#### Post date: [January 23, 2020, 1:12pm UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/7 "2020-01-23T13:12:40Z")

</div>

I don’t understand why you are using an older version of PostgreSQL than would have been installed or upgraded for [v1.9.0.beta17 +38]

Did you install by some method other than the official Discourse install method? See the [official install](https://meta.discourse.org/t/142537?silent=true) method at [discourse/docs/INSTALL.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL.md)

Whatever you do make sure that you have a backup.

Check that you have enough disk space for the PostgreSQL upgrade. They say you need free space twice the size of the database:

> [@Issue Rebuilding App Failing on Postgres Upgrade](https://meta.discourse.org/t/issue-rebuilding-app-failing-on-postgres-upgrade/91278):
>
> Trying to do a launcher rebuild and getting this error I, [2018-06-30T18:56:08.346656 #17] INFO -- : I, [2018-06-30T18:56:08.346728 #17] INFO -- : \> chown -R postgres:postgres /shared/postgres\_data I, [2018-06-30T18:56:08.357457 #17] INFO -- : I, [2018-06-30T18:56:08.357700 #17] INFO -- : \> chown -R postgres:postgres /var/run/postgresql I, [2018-06-30T18:56:08.359892 #17] INFO -- : I, [2018-06-30T18:56:08.360109 #17] INFO -- : \> /root/upgrade\_postgres I, [2018-06-30T18:56:08.374537 #17] …

The other two topics I posted previously may also help but I’m not sure of the source of your problem.

---

<div class="post-metadata">

### Author: ![tereensio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tereensio/32/167127_2.png) [@tereensio](https://meta.discourse.org/u/tereensio)
#### Post date: [January 23, 2020, 1:21pm UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/8 "2020-01-23T13:21:18Z")

</div>

> "I don’t understand why you are using an older version of PostgreSQL than would have been installed or upgraded for [v1.9.0.beta17 +38]
> 
> Did you install by some method other than the official Discourse install method? See the [official install](https://meta.discourse.org/t/142537?silent=true) method at [discourse/INSTALL.md at master · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL.md)"

Me neither. 🙂

I have upgraded via the /admin section at the webservice.

Now the webservice says I have to update manually.

Manual upgrade fails.

That is the situation.

I wonder of there is a way to manually upgrade PostgreSQL first, then try to upgarde Disocurse. Would that work?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [January 23, 2020, 1:24pm UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/9 "2020-01-23T13:24:24Z")

</div>

That PG 9.3 is really old, and it doesn’t sound right for a v1.9 Discourse install.

If I were you I would make a backup, create a new host with an up to date Discourse, restore the backup and move the hostname to the new server.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 23, 2020, 1:33pm UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/10 "2020-01-23T13:33:00Z")

</div>

Do you have a separate data container or are you using an external database?

In any case, I would first try the route that Richard just suggested.

---

<div class="post-metadata">

### Author: ![tereensio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tereensio/32/167127_2.png) [@tereensio](https://meta.discourse.org/u/tereensio)
#### Post date: [January 23, 2020, 1:54pm UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/11 "2020-01-23T13:54:28Z")

</div>

> Do you have a separate data container or are you using an external database?

How can I tell? I mean, how do I know/find out?

---

<div class="post-metadata">

### Author: ![tereensio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tereensio/32/167127_2.png) [@tereensio](https://meta.discourse.org/u/tereensio)
#### Post date: [January 23, 2020, 1:56pm UTC](https://meta.discourse.org/t/manual-upgrade-fails/139277/12 "2020-01-23T13:56:59Z")

</div>

> If I were you I would make a backup, create a new host with an up to date Discourse, restore the backup and move the hostname to the new server.

Ok, I think I’ll try this.
