Example done from an upgrade from 12.5 to 15.4
App is a Rails app, the default container user has limited access and no direct sql/psql access
- build the image with current pg version & docker compose up
docker exec -it <NAME_OF_CONTAINER> pg_dump <NAME_OF_PRIMARY_DB> > db.out -U postgres- had issues doing pg_dumpall; wondering if the default postgres database interferred?
- backup the data from the volume. I store in a tmp folder in the repo.
- clear the folder your data is saved in or delete the volume
- update the postgres version in docker compose, run docker compose build & up