Backup Failed error

I have external Database which is 16.3 version, and i have web_only container in that i have psql (PostgreSQL) 15.12 getting error while backup. how to resolve version issue.
Thanks

Could you send the error here, formatted in triple backticks (```)?
Thanks!

[2025-05-08 03:32:20] 'system' has started the backup!
[2025-05-08 03:32:20] Marking backup as running...
[2025-05-08 03:32:20] Making sure '/var/www/discourse/tmp/backups/default/2025-05-08-033220' exists...
[2025-05-08 03:32:20] Making sure '/var/www/discourse/public/backups/default' exists...
[2025-05-08 03:32:20] Updating metadata...
[2025-05-08 03:32:20] Dumping the public schema of the database...
[2025-05-08 03:32:20] pg_dump: error: aborting because of server version mismatch
[2025-05-08 03:32:20] pg_dump: detail: server version: 16.3; pg_dump version: 15.12 (Debian 15.12-1.pgdg120+1)
[2025-05-08 03:32:20] EXCEPTION: pg_dump failed
[2025-05-08 03:32:20] /var/www/discourse/lib/backup_restore/backuper.rb:173:in dump_public_schema```

Perhaps it is the fact that IIRC Discourse has support for up to Postgres 15?

And perhaps it is also the fact that the two database versions are not the same (one 16 and the other 15)?

I’m pretty sure that the issue is that you’ve got 16 and Discourse has the PG15 tools. You need to go into the container and switch to the PG16 tools.

The longer-term solution is to add code to your app.yml that will upgrade the PG tools when you build a new container.

I did that for someone a while back but I’m not working for them now and can’t find my code.

You’d google “how to upgrade to PG16” and then do that inside the container. Then you’d add stuff to the app.yml to do it when it rebuilds.

1 Like