From 38c464ebaec35551e66658c4e79a89d3b05892b4 Mon Sep 17 00:00:00 2001 From: FaySmash <30392780+FaySmash@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:56:45 +0100 Subject: [PATCH] Improved the understandability of the postgres upgrade steps I improved the understandability some parts in the psql examples for someone not familiar with the psql syntax. --- docs/faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 6c8e5aa5..5c81caf3 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -124,13 +124,13 @@ to your dream setup. ## How can I upgrade postgres (major versions)? Postgres requires manual intervention when updating from one major version to another. The steps are roughly -1. use `pg_dumpall` to dump your database into SQL (for Docker `docker-compose exec -T pg_dumpall -U -f /path/to/dump.sql`) +1. use `pg_dumpall` to dump your database into SQL (for Docker `docker-compose exec -T pg_dumpall -U -f /path/to/dump.sql`) 2. stop the DB / down the container 3. move your postgres directory in order to keep it as a backup (e.g. `mv postgres postgres_old`) 4. update postgres to the new major version (for Docker just change the version number and pull) 5. start the db / up the container (do not start tandoor as it will automatically perform the database migrations which will conflict with loading the dump) 6. if not using docker, you might need to create the same postgres user you had in the old database -7. load the postgres dump (for Docker `'/usr/local/bin/docker-compose exec -T psql -U postgres < /path/to/dump.sql`) +7. load the postgres dump (for Docker `'/usr/local/bin/docker-compose exec -T psql -U < /path/to/dump.sql`) If anything fails, go back to the old postgres version and data directory and try again.