[1.19] Upgrade from 1.18 to 1.19 - Postgres 15 to 18 migration

Author Topic
admin

Posted on #

Due to paranoia, I have upgraded Postgres engine from version 15 to 18, which will break existing setups.

Here’s migration:

1. Back up

docker compose exec db pg_dumpall -U vpub --clean > vpub-pg15-backup-$(date +%F).sql
ls -la vpub-pg15-backup-*.sql

2. Stop the stack and remove the old data volume

docker compose down
docker volume rm vpub-plus_db_data # or you can save it if you want I guess

3. Update the repo and start fresh Posgres 18

git pull
docker compose pull db
docker compose up -d db
docker compose logs db   # should be "database system is ready to accept connections"
docker exec <db-container> psql -U vpub -d vpub -t -c "SHOW server_version;" # should output 18.6

4. Restore

docker exec -i <db-container> psql -U vpub -d postgres < vpub-pg15-backup-<date>.sql