915 B
915 B
HOW TO UPDATE POSTGRES DATABASE
If you want to upgrade your database version (say from postgres 14 to 15)
-
Create a backup of your instance! Or at least a copy of the postgres folder!
-
Dump your database with the following command:
docker exec -u pleroma pleroma_db pg_dump -Fc pleroma > db.dump
-
Change the image tag for your db under
docker-compose.yml
-
Delete your existing postgres folder with
rm -rvf postgres
-
Bring up only the database container with
docker compose up db -d
- Restore your database backup into the new database with
docker exec -i -u pleroma pleroma_db pg_restore -C -d postgres < db.dump
- 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.