From 46b18ee2ae8cb011e66036edb51e5eb560335a1f Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Fri, 13 Nov 2026 04:21:38 +0400 Subject: [PATCH] Postgres 18.7 Move the shared Postgres from 17 to 18.7 by dump and restore into a new volume, pg_data_18, mounted at /var/lib/postgresql as the 18 image requires (PGDATA moved to /var/lib/postgresql/18/docker). The 17 data volume stays as it was. Procedure (2026-11-13): restic snapshot and pg_dumpall to S3; stop asxpio, asxpio-monitor and datacenterbingo; final pg_dumpall; deploy this; restore the dump; compare per-table row counts; start the apps. Rollback: revert this commit and redeploy (17.12 on the untouched pg_data), then start the apps. Writes made on 18 in between would need a pg_dump from 18 to carry over. Assisted-by: Claude:opus-5-5 --- docker-compose.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index bba3f50..29a5b6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: postgres: - image: postgres:17-alpine + image: postgres:18.7-alpine container_name: storage-postgres restart: unless-stopped environment: @@ -8,7 +8,9 @@ services: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: postgres volumes: - - pg_data:/var/lib/postgresql/data + # Postgres 18's image keeps PGDATA in /var/lib/postgresql/18/docker + # and refuses the old /var/lib/postgresql/data mount + - pg_data_18:/var/lib/postgresql networks: - storage healthcheck: @@ -18,7 +20,7 @@ services: retries: 10 postgres-init: - image: postgres:17-alpine + image: postgres:18.7-alpine container_name: storage-postgres-init depends_on: postgres: @@ -79,7 +81,10 @@ services: - "traefik.http.services.garage-web.loadbalancer.server.port=3902" volumes: + # Postgres 17's data, left untouched by the move to 18: the rollback. + # Remove once 18 has run well. pg_data: + pg_data_18: garage_meta: garage_data: