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
Смотрите видео How to Upgrade PostgreSQL from 9.x to 10 on CentOS / Red Hat? онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Mustafa Akdemir 29 Октябрь 2017, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7,735 раз и оно понравилось 22 людям.