Created
May 8, 2020 12:02
-
-
Save rubinhozzz/6816f8da31f4dc2683aa027dca6b33d7 to your computer and use it in GitHub Desktop.
Upgrade for postgresql versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. pg_lsclusters | |
2. Stop all clusters, even the new one you want to use. | |
pg_ctlcluster <version> main stop | |
3. cd /tmp | |
4. sudo -H -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' | |
if working: | |
5. Change following values in /etc/postgresql/12/main/postgresql.conf | |
listen_addresses = '*' | |
port = 5432 | |
6. Change file: /etc/postgresql/12/main/pg_hba.conf | |
This one: | |
local all all peer | |
for: | |
local all all md5 | |
and add: | |
host all all 0.0.0.0/0 md5 | |
7. sudo pg_ctlcluster 12 main start | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment