From dccc57338e7e2d8898c14868b7262420bcbaa531 Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 16 Dec 2020 17:40:43 +0100 Subject: [PATCH] ad postgress upgrade procedure --- IT/SQL/PostgreSQL/Upgrade.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 IT/SQL/PostgreSQL/Upgrade.md diff --git a/IT/SQL/PostgreSQL/Upgrade.md b/IT/SQL/PostgreSQL/Upgrade.md new file mode 100644 index 0000000..c905f6e --- /dev/null +++ b/IT/SQL/PostgreSQL/Upgrade.md @@ -0,0 +1,28 @@ +# Upgrading PostgreSQL Database + +when major release of postgresql is done you need to do some manual action +if not done you can meet issue during request + +## action + +**need to have postgresqk-old-upgrade installed on arch** + +- stop service +```systemctl stop postgresql.service``` +- rename cluster directory +```mv /var/lib/postgres/data /var/lib/postgres/olddata +mkdir /var/lib/postgres/data /var/lib/postgres/tmp +chown postgres:postgres /var/lib/postgres/data /var/lib/postgres/tmp +``` +- log in postgres account +``` +sudo -iu postgres +cd /var/lib/postgres/tmp + +``` +- launch upgrade +``` +pg_upgrade -b /opt/pgsql-PG_VERSION/bin -B /usr/bin -d /var/lib/postgres/olddata -D /var/lib/postgres/data +``` +- check both pg_hba.conf in new and old cluster +- restart server `sc-start postgresql`