Python / Odoo Developer

Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Upgrade Postgres

Avatar
Administrator

Open

Add the PostgreSQL package repository on your linux machine

echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main 11" | tee /etc/apt/sources.list.d/pgsql.list

Add the GPG key of the PostgreSQL package repository

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

Update sources and install new postgres version

apt update && postgresql-12 postgresql-server-dev-12

Stop all postgres instances running

systemctl stop postgresql.service

Run the upgrade

/usr/lib/postgresql/12/bin/pg_upgrade -v -d /etc/postgresql/9.6/main -D /etc/postgresql/12/main/ -b /usr/lib/postgresql/9.6/bin/ -B /usr/lib/postgresql/12/bin/

Here change port to 5432

vim /etc/postgresql/12/main/postgresql.conf

 Start postgres service

systemctl start postgresql.service


If needed remove old postgres

Check installed postgres

apt list --installed | grep postgresql

Remove old version from folder

rm -rf /etc/postgresql/11/


Disable postgres version from run

/etc/postgresql/9.1/main/start.conf

Change from auto to disable. See here 


Avatar
Discard