# Backup Failed error

**URL:** https://meta.discourse.org/t/backup-failed-error/365262
**Category:** Support
**Created:** [May 8, 2025, 5:58am UTC](https://meta.discourse.org/t/backup-failed-error/365262 "2025-05-08T05:58:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Aniket](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aniket/32/456890_2.png) [@Aniket](https://meta.discourse.org/u/Aniket)
#### Post date: [May 8, 2025, 5:58am UTC](https://meta.discourse.org/t/backup-failed-error/365262/1 "2025-05-08T05:58:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [May 8, 2025, 6:19am UTC](https://meta.discourse.org/t/backup-failed-error/365262/3 "2025-05-08T06:19:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Aniket](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aniket/32/456890_2.png) [@Aniket](https://meta.discourse.org/u/Aniket)
#### Post date: [May 8, 2025, 10:15am UTC](https://meta.discourse.org/t/backup-failed-error/365262/4 "2025-05-08T10:15:37Z")

</div>

````plaintext
[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```
````

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [May 8, 2025, 11:09am UTC](https://meta.discourse.org/t/backup-failed-error/365262/5 "2025-05-08T11:09:46Z")

</div>

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

> [@PostgreSQL 15 update](https://meta.discourse.org/t/postgresql-15-update/349515):
>
> warning WARNING! If your database is very large, you will need a lot of extra disk space (2x database size) and should be very careful with this upgrade! We’ve just landed changes to upgrade our Docker image to PostgreSQL 15. Any site admins rebuilding Discourse from the command line will be upgraded to PostgreSQL 15 from the previous PostgreSQL 13. Note that if you held back from upgrading when the PostgreSQL 13 update [happened back in 2020](https://meta.discourse.org/t/postgresql-13-update/172563), you can skip that upgrade and go straight to P…

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

---

<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: [May 8, 2025, 6:37pm UTC](https://meta.discourse.org/t/backup-failed-error/365262/6 "2025-05-08T18:37:57Z")

</div>

> [@Aniket](#):
>
> 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. h

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.

---

<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: [June 7, 2025, 6:38pm UTC](https://meta.discourse.org/t/backup-failed-error/365262/7 "2025-06-07T18:38:29Z")

</div>

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