Change db volume version, and add hints to upgrade it in the future

This isn't strictly necessary, this is just artifacts of the upgrade
process I did—and I figure may as well leave them here to help me in
the future if I need to do it again!
This commit is contained in:
Emi Matchu 2024-08-27 12:18:25 -07:00
parent a7f3ee50d5
commit 6548666b95

View file

@ -5,7 +5,7 @@ services:
image: postgres:16-alpine
restart: always
volumes:
- db-data:/var/lib/postgresql/data
- db-data-v16:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
@ -35,7 +35,13 @@ services:
- plausible-conf.env
volumes:
db-data:
# NOTE: When it comes time to upgrade Postgres, you should:
# 1. Manually export the database with `pg_dumpall` (via `docker exec`).
# 2. Change the version number of this volume, to create a fresh data directory.
# 3. Upgrade the Postgres version, and don't let Plausible itself run yet (so it doesn't init an empty DB).
# 4. Import the database with `psql` (via `docker exec`).
# 5. (Optional) Remove the previous volume with `docker volume rm db-data-vXX`.
db-data-v16:
driver: local
event-data:
driver: local