# Trouble updating discourse after some time - UPGRADE OF POSTGRES FAILED

**URL:** https://meta.discourse.org/t/trouble-updating-discourse-after-some-time-upgrade-of-postgres-failed/389116
**Category:** Support
**Created:** [19 november 2025 om 22:33 UTC](https://meta.discourse.org/t/trouble-updating-discourse-after-some-time-upgrade-of-postgres-failed/389116 "2025-11-19T22:33:48Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![nickharambee1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nickharambee1/32/530393_2.png) [@nickharambee1](https://meta.discourse.org/u/nickharambee1)
#### Post date: [19 november 2025 om 22:33 UTC](https://meta.discourse.org/t/trouble-updating-discourse-after-some-time-upgrade-of-postgres-failed/389116/1 "2025-11-19T22:33:48Z")

</div>

I haven’t upgraded discourse in quite some time and tried to do so today. In my browser at `admin/update` I get the message that everything is up to date, but it is showing version v2.4.0.beta2 +17 and I understand that the latest version is 3.6.0.beta2.

So I tried updating via terminal using ./launcher rebuild app and the update failed, with the message UPGRADE OF POSTGRES FAILED. I read the [support page](https://meta.discourse.org/t/postgresql-13-update/172563) and followed all instructions there and in similar posts about POSTGRES update issues, but haven’t been able to fix the issue.

I did look at the logs in /var/discourse/shared/standalone/log/var-log/postgres and found repeated error messages, such as this:

`2025-11-19 21:42:13.815 GMT [242] LOG: skipping missing configuration file “/shared/postgres_data/postgresql.auto.conf”`  
`2025-11-19 21:42:13.816 UTC [242] FATAL: data directory “/shared/postgres_data” has wrong ownership`  
`2025-11-19 21:42:13.816 UTC [242] HINT: The server must be started by the user that owns the data directory.`

One thing I don’t understand is that there is no directory `/shared/postgres_data` - but rather `/shared/standalone/postgres_data.`

The error message from terminal is included below. I’d be grateful for any pointers to get the update working.

Thanks,

Nick

* * *

```plaintext
Success. You can now start the database server using:

    /usr/lib/postgresql/13/bin/pg_ctl -D /shared/postgres_data_new -l logfile start

Ign:1 
 buster-pgdg InRelease

Ign:2 
 buster/updates InRelease

Err:3 
 buster-pgdg Release

  404 Not Found [IP: 151.101.67.52 80]

Err:4 
 buster/updates Release

  404 Not Found [IP: 151.101.2.132 80]

Ign:5 
 buster InRelease

Ign:6 
 buster-updates InRelease

Err:7 
 buster Release

  404 Not Found [IP: 151.101.2.132 80]

Err:8 
 buster-updates Release

  404 Not Found [IP: 151.101.2.132 80]

Get:9 https://deb.nodesource.com/node_15.x buster InRelease [4,584 B]

Reading package lists...

Reading package lists...

Building dependency tree...

Reading state information...

The following additional packages will be installed:

  postgresql-client-10

Suggested packages:

  postgresql-doc-10

The following NEW packages will be installed:

  postgresql-10 postgresql-client-10

0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.

Need to get 6,441 kB of archives.

After this operation, 30.6 MB of additional disk space will be used.

Err:1 
 buster-pgdg/main amd64 postgresql-client-10 amd64 10.17-1.pgdg100+1

  404 Not Found [IP: 151.101.195.52 80]

Err:2 
 buster-pgdg/main amd64 postgresql-10 amd64 10.17-1.pgdg100+1

  404 Not Found [IP: 151.101.195.52 80]

Stopping PostgreSQL 13 database server: main.

check for "/usr/lib/postgresql/10/bin" failed: No such file or directory

Failure, exiting

-------------------------------------------------------------------------------------

UPGRADE OF POSTGRES FAILED

Please visit 
 for support.

You can run ./launcher start app to restart your app in the meanwhile

FAILED

--------------------

Pups::ExecError: /root/upgrade_postgres failed with return #<Process::Status: pid 50 exit 1>

Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'

exec failed with the params "/root/upgrade_postgres"

9f400ba2cca88f79359496e95027cf26c2d5a3672837c5594793cf723585407b

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

```

---

<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: [20 november 2025 om 15:19 UTC](https://meta.discourse.org/t/trouble-updating-discourse-after-some-time-upgrade-of-postgres-failed/389116/2 "2025-11-20T15:19:01Z")

</div>

YOu need to rebuild at the command line, twice. See [PostgreSQL 15 update](https://meta.discourse.org/t/postgresql-15-update/349515)

> [@nickharambee1](#):
>
> One thing I don’t understand is that there is no directory `/shared/postgres_data` - but rather `/shared/standalone/postgres_data.`

Hmm. It’s possible that you have a non-standard bind in your `app.yml`. Your OS is almost certainly out of date too. I recommend moving to a new VM and restoring the database there. See [Move a Discourse site to another VPS with rsync](https://meta.discourse.org/t/move-a-discourse-site-to-another-vps-with-rsync/43812).

Don’t copy the database. It’s easier to restore a backup.

---

<div class="post-metadata">

### Author: ![nickharambee1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nickharambee1/32/530393_2.png) [@nickharambee1](https://meta.discourse.org/u/nickharambee1)
#### Post date: [20 november 2025 om 16:27 UTC](https://meta.discourse.org/t/trouble-updating-discourse-after-some-time-upgrade-of-postgres-failed/389116/3 "2025-11-20T16:27:15Z")

</div>

Thanks for your reply Jay. OK, I have created a new VM and followed the steps in the article under **Prepare new VPS.** Now I am not sure what to do - do I continue to the steps under **Copy files to new VPS**? I wondering whether I’m doing a fresh install of discourse and then restoring the database from the old installation, or copying the discourse files over from the old installation? I’m thinking that if I just copy over the discourse files from the old VM then the issues might be replicated on the new VM, but probably I am misunderstanding something.

---

<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: [20 november 2025 om 16:38 UTC](https://meta.discourse.org/t/trouble-updating-discourse-after-some-time-upgrade-of-postgres-failed/389116/4 "2025-11-20T16:38:59Z")

</div>

Since it’s so old, I think I’d recommend just doing a clean install and copying only the backup to the new server.

- backup old site
- `rsync -rav oldsite:/var/discourse/shared/backups /var/discourse/shared/`
- switch DNS to new server
- `./discourse-setup` (get your SMTP values from the old app.yml) on new server
- `./launcher enter app`
- `discourse backup` (this will create the default backup directory with the right permissions)
- `discourse enable_restore`
- `discourse restore` (this will print the available backups)
- copy-paste the restore command

A more complicated version would be to rsync everything except the database like this:

```plaintext
rsync -rav --numeric-ids OLD-IP:/var/discourse/shared/ /var/discourse/shared/ --exclude log --exclude postgres_* --exclude redis_data --exclude letsencrypt --exclude ssl --exclude log --exclude tmp --exclude state

```

---

<div class="post-metadata">

### Author: ![nickharambee1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nickharambee1/32/530393_2.png) [@nickharambee1](https://meta.discourse.org/u/nickharambee1)
#### Post date: [20 november 2025 om 23:00 UTC](https://meta.discourse.org/t/trouble-updating-discourse-after-some-time-upgrade-of-postgres-failed/389116/5 "2025-11-20T23:00:11Z")

</div>

Thanks again Jay. I have managed to do a fresh install of discourse and restore the backup from the old VM using your instructions and all seems to be working well. Must remember to update more often!

---

<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: [21 november 2025 om 00:56 UTC](https://meta.discourse.org/t/trouble-updating-discourse-after-some-time-upgrade-of-postgres-failed/389116/6 "2025-11-21T00:56:25Z")

</div>

Great! That’s awesome. Glad it worked!

If my post was the solution, please click the ✔ so that the topic gets closed.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [21 december 2025 om 00:56 UTC](https://meta.discourse.org/t/trouble-updating-discourse-after-some-time-upgrade-of-postgres-failed/389116/7 "2025-12-21T00:56:50Z")

</div>

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