Skip to content

Instantly share code, notes, and snippets.

@Nurlan199206
Created June 23, 2023 07:49
Show Gist options
  • Save Nurlan199206/47053e717cb3cadb740223c18a7a747d to your computer and use it in GitHub Desktop.
Save Nurlan199206/47053e717cb3cadb740223c18a7a747d to your computer and use it in GitHub Desktop.
pg_upgrade 13 to 15 version
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null
sudo apt update -y
apt install postgresql-15
service postgresql stop
/usr/lib/postgresql/15/bin/pg_upgrade \
--old-datadir=/var/lib/postgresql/13/main \
--new-datadir=/var/lib/postgresql/15/main \
--old-bindir=/usr/lib/postgresql/13/bin \
--new-bindir=/usr/lib/postgresql/15/bin \
--old-options '-c config_file=/etc/postgresql/13/main/postgresql.conf' \
--new-options '-c config_file=/etc/postgresql/15/main/postgresql.conf'
mcedit /etc/postgresql/15/main/postgresql.conf - swithc port to 5432
su - postgres
psql
select version ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment