Browse Source

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/
merge-requests/85/head
Deimos 5 years ago
parent
commit
ca509b220b
  1. 2
      salt/pillar/dev.sls
  2. 2
      salt/pillar/prod.sls

2
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

2
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::'

Loading…
Cancel
Save