diff --git a/docker-compose.postgres.yml b/docker-compose.postgres.yml index df2aef166..574fc1124 100644 --- a/docker-compose.postgres.yml +++ b/docker-compose.postgres.yml @@ -27,8 +27,8 @@ # path). An existing database stays on the major it was created with: when # you update this file, keep your image tag and volume path. Moving to # another major needs pg_upgrade, or a dump and restore (a TREK backup -# restored into a new, empty database works across majors), never just a -# new image tag. +# restored into a new, empty database of the same or a newer major), never +# just a new image tag. services: db: image: postgres:18 diff --git a/wiki/Database-Postgres.md b/wiki/Database-Postgres.md index 655e3f9d1..77df3add2 100644 --- a/wiki/Database-Postgres.md +++ b/wiki/Database-Postgres.md @@ -82,7 +82,7 @@ The file uses PostgreSQL 18, the newest version TREK supports, which matches the To run 14 to 17, change both the image tag and the volume path in the `db` service. The 18 image refuses a volume at `/var/lib/postgresql/data`, and a 14 to 17 image with its volume one level up would keep the data in an anonymous volume, which `docker compose down` leaves behind, so the next start comes up on an empty database. -A database stays on the major version it was created with. When you update `docker-compose.postgres.yml`, keep the image tag and the volume path of your existing database. A new image tag on the old volume does not bring the data along: the 18 image refuses a volume that holds an older database, and an older image does not find the data of a newer one. To move a database to another major, use `pg_upgrade`, or dump and restore it: take a backup under **Admin > Backup** and download it, start the new major on a new, empty volume, and restore the backup there, on the first start with `RESTORE_FROM_BACKUP` (see [Backups and restore](#backups-and-restore)) or under **Admin > Backup**. TREK's backups restore across majors. +A database stays on the major version it was created with. When you update `docker-compose.postgres.yml`, keep the image tag and the volume path of your existing database. A new image tag on the old volume does not bring the data along: the 18 image refuses a volume that holds an older database, and an older image does not find the data of a newer one. To move a database to another major, use `pg_upgrade`, or dump and restore it: take a backup under **Admin > Backup** and download it, start the new major on a new, empty volume, and restore the backup there, on the first start with `RESTORE_FROM_BACKUP` (see [Backups and restore](#backups-and-restore)) or under **Admin > Backup**. TREK's backups restore into the same or a newer major; TREK refuses a backup from a newer major than the server it restores into. ### A role that is not a superuser @@ -215,7 +215,7 @@ Restoring a backup on Postgres follows these rules: - **The current database is replaced.** TREK first keeps a copy of it as `data/pre-restore-