docker-pleroma/UPDATE-DB.md
2023-08-13 01:50:00 -04:00

915 B

HOW TO UPDATE POSTGRES DATABASE

If you want to upgrade your database version (say from postgres 14 to 15)

  1. Create a backup of your instance! Or at least a copy of the postgres folder!

  2. Dump your database with the following command:

docker exec -u pleroma pleroma_db pg_dump -Fc pleroma > db.dump

  1. Change the image tag for your db under docker-compose.yml

  2. Delete your existing postgres folder with rm -rvf postgres

  3. Bring up only the database container with

docker compose up db -d

  1. Restore your database backup into the new database with

docker exec -i -u pleroma pleroma_db pg_restore -C -d postgres < db.dump

  1. Launch pleroma_web with the following command and watch for errors

docker compose up web -d

docker compose logs web db -f

Should there be any errors... well that's what backups are for! Restore from the backup you made.