This is video will show how to upgrade PostgreSQL Database
Server from 9.x to 10 on CentOS 7 / Red Hat 7
Here is the commands:
// Add the latest repository RPM for your OS
// Install PG
yum install postgresql10-server
postgresql10-contrib postgresql10-client
// Create Postgres 10 data directory:
/usr/pgsql-10/bin/postgresql10-setup initdb
// Now you have two data directories, /var/lib/pgsql/10
// and /var/lib/pgsql/9.6 in our case.
// Let’s check the ability to upgrade your data
// from 9.6 to 10:
$ su - postgres // pg_upgrade cannot be run as root
$ cd ~
$ /usr/pgsql-10/bin/pg_upgrade
--old-bindir=/usr/pgsql-9.6/bin/
--new-bindir=/usr/pgsql-10/bin/
--old-datadir=/var/lib/pgsql/9.6/data/
--new-datadir=/var/lib/pgsql/10/data/
--check // check only, won't change any data
systemctl stop postgresql-9.6.service
// Now back to the postgres user and run:
/usr/pgsql-10/bin/pg_upgrade
--old-bindir=/usr/pgsql-9.6/bin/
--new-bindir=/usr/pgsql-10/bin/
--old-datadir=/var/lib/pgsql/9.5/data/
--new-datadir=/var/lib/pgsql/10/data/
// Run as root:
systemctl start postgresql-10.service
// Enable the service to auto start on launch:
systemctl enable postgresql-10.service
// The pg_upgrade script creates two new scriptions
// in its working directory, analyze_new_cluster.sh
// and delete_old_cluster.sh Depending on the size
// of your database probably a good idea to
// run analyze_new_cluster.sh:
su - postgres
$ ./analyze_new_cluster.sh
Watch video How to Upgrade PostgreSQL from 9.x to 10 on CentOS / Red Hat? online without registration, duration hours minute second in high quality. This video was added by user Mustafa Akdemir 29 October 2017, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7,735 once and liked it 22 people.