From ca509b220b7db1efc5929f91fc4ded3e52c5a9dd Mon Sep 17 00:00:00 2001 From: Deimos Date: Sun, 20 Oct 2019 12:44:47 -0600 Subject: [PATCH] Update PostgreSQL version to 12 Changing these pillar values are the only actual changes to Tildes code/config needed, but if you're upgrading an existing version from 10 to 12 you will need to do some manual steps. The below should cover it - lines starting with a * are descriptions of things you need to do, while the rest are actual commands to run: sudo apt-get install postgresql-12 sudo systemctl stop postgresql@10-main.service sudo systemctl stop postgresql@12-main.service cd /var/lib/postgresql sudo -u postgres /usr/lib/postgresql/12/bin/pg_upgrade -b /usr/lib/postgresql/10/bin/ -B /usr/lib/postgresql/12/bin/ -d /var/lib/postgresql/10/main/ -D /var/lib/postgresql/12/main/ -o '-c config_file=/etc/postgresql/10/main/postgresql.conf' -O '-c config_file=/etc/postgresql/12/main/postgresql.conf' * Change pillar value to 12, and run salt sudo systemctl stop postgresql@10-main.service * Edit /etc/postgresql/12/main/postgresql.conf and change port to 5432 sudo systemctl restart postgresql@12-main.service sudo -u postgres ./analyze_new_cluster.sh * After verifying the new version seems to be working, clean up the old version: sudo apt-get remove postgresql-10 sudo rm -rf /usr/lib/postgresql/10/ sudo rm -rf /var/lib/postgresql/10/ sudo rm -rf /etc/postgresql/10/ --- salt/pillar/dev.sls | 2 +- salt/pillar/prod.sls | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/pillar/dev.sls b/salt/pillar/dev.sls index 34705ce..d756afd 100644 --- a/salt/pillar/dev.sls +++ b/salt/pillar/dev.sls @@ -2,6 +2,6 @@ ini_file: development.ini ssl_cert_path: /etc/pki/tls/certs/localhost.crt ssl_private_key_path: /etc/pki/tls/certs/localhost.key nginx_worker_processes: 1 -postgresql_version: 10 +postgresql_version: 12 prometheus_ips: ['127.0.0.1'] site_hostname: localhost diff --git a/salt/pillar/prod.sls b/salt/pillar/prod.sls index 4966d3c..3a3a417 100644 --- a/salt/pillar/prod.sls +++ b/salt/pillar/prod.sls @@ -3,7 +3,7 @@ ssl_cert_path: /etc/letsencrypt/live/tildes.net/fullchain.pem ssl_private_key_path: /etc/letsencrypt/live/tildes.net/privkey.pem hsts_max_age: 63072000 nginx_worker_processes: auto -postgresql_version: 10 +postgresql_version: 12 prometheus_ips: ['144.217.93.123'] site_hostname: tildes.net ipv6_address: '2607:5300:0203:2dd8::'