Hello,
Today I install postgresql16 with an installed postgresql15, looking how to do pg_upgrade
, found that all distro except openSUSe have a folder with the data version (/usr/lib/postgresql{15,16}/data or /var/lib/pgsql/data{15,16}).
following the command structure:
pg_upgrade --old-bindir=BINDIR \
--new-bindir=BINDIR \
--old-datadir=DATADIR \
--new-datadir=DATADIR \
So, following this with openSUSe installation, we will have:
pg_upgrade --old-bindir=/usr/lib/postgresql15/bin \
--new-bindir=/usr/lib/postgresql16/bin \
--old-datadir=/var/lib/pgsql/data (default) \
--new-datadir=/var/lib/pgsql/data (replace itself?) \
don’t know if this is safe to do or which will be the best approach to this.
maybe cp -r /var/lib/pgsql/data /var/lib/pgsql/data.old
and do:
pg_upgrade --old-bindir=/usr/lib/postgresql15/bin \
--new-bindir=/usr/lib/postgresql16/bin \
--old-datadir=/var/lib/pgsql/data.old \
--new-datadir=/var/lib/pgsql/data \
Which one is the best practice to do the upgrade?