diff --git a/README.md b/README.md index d206f384..7eea58f7 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,19 @@ Redash for redundancy. You will also need to tweak the number of workers based o See [Upgrade Guide](https://redash.io/help/open-source/admin-guide/how-to-upgrade). +### How do I backup my PostgreSQL database? + +``` +# docker compose -f /opt/redash/compose.yaml exec -T postgres pg_dumpall -U postgres > backup-$(date +%Y%m%d).sql +``` + +### How do I upgrade PostgreSQL to a newer major version? + +If you are running PostgreSQL 17 or earlier and want to upgrade to PostgreSQL 18, you need to update the volume mount +path in your `/opt/redash/compose.yaml`. See the +[pgautoupgrade documentation](https://github.com/pgautoupgrade/docker-pgautoupgrade#error-message-when-mounting-data-to-varlibpostgresqldata-on-postgres-v18) +for details. + ### How do I use `setup.sh` on a different operating system? You will need to create a docker installation function that suits your operating system, and maybe other functions as diff --git a/data/compose.yaml b/data/compose.yaml index a2dab484..5482d193 100644 --- a/data/compose.yaml +++ b/data/compose.yaml @@ -38,14 +38,22 @@ services: image: redis:7-alpine restart: unless-stopped postgres: - # [IMPORTANT] - # We intentionally fix the version to v17 to avoid automatic upgrade to v18 (or later). - # If you want to upgrade to v18, please refer to the official upgrade guide: - # https://github.com/pgautoupgrade/docker-pgautoupgrade#one-shot-mode - image: pgautoupgrade/pgautoupgrade:17-alpine + # pgautoupgrade can perform PostgreSQL major version upgrades when you update this image tag to a newer major version. + # + # [NOTE FOR EXISTING USERS] + # If upgrading from PG17 or earlier, the volume mount path has changed. + # Backup your data first, then stop containers and update your volume from: + # /opt/redash/postgres-data:/var/lib/postgresql/data + # to: + # /opt/redash/postgres-data:/var/lib/postgresql + # + # pgautoupgrade will automatically migrate your data to the new directory structure. + # + # Details: https://github.com/pgautoupgrade/docker-pgautoupgrade#error-message-when-mounting-data-to-varlibpostgresqldata-on-postgres-v18 + image: pgautoupgrade/pgautoupgrade:18-alpine env_file: /opt/redash/env volumes: - - /opt/redash/postgres-data:/var/lib/postgresql/data + - /opt/redash/postgres-data:/var/lib/postgresql restart: unless-stopped nginx: image: redash/nginx:latest