{"id":667,"date":"2019-04-17T00:12:16","date_gmt":"2019-04-17T04:12:16","guid":{"rendered":"http:\/\/jasonralph.org\/?p=667"},"modified":"2019-11-13T19:07:18","modified_gmt":"2019-11-14T00:07:18","slug":"cenots-postgres-pg_upgrade-9-to-11-in-place-link-no-copy-limited-disk-space","status":"publish","type":"post","link":"https:\/\/jasonralph.org\/?p=667","title":{"rendered":"CENTOS6 Postgres pg_upgrade 9 to 11 &#8211; In Place &#8211; Link &#8211; No Copy &#8211; Limited Disk Space"},"content":{"rendered":"<p>I wanted to share my experience with upgrading postgres database server from major version 9 to 11.  I am showing the steps that I took to get many servers in dev and production upgraded with limited disk space(not enough space to copy).  I am hoping this will help with the problems I faced when testing this procedure.  Using the &#8211;link parameter has drawbacks as noted in the documentation, however we perform full VM backups of each server so we can always restore from backup if the upgrade fails and we will not need to start the pg9.3 database again. <\/p>\n<p>https:\/\/www.postgresql.org\/docs\/11\/pgupgrade.html<\/p>\n<p><code>-k<br \/>\n--link<\/p>\n<p>    use hard links instead of copying files to the new cluster<br \/>\nIf you ran pg_upgrade with --link, the data files are shared between the old and new cluster. If you started the new cluster, the new server has written to those shared files and it is unsafe to use the old cluster.<\/code><\/p>\n<p><strong><\/p>\n<blockquote><p>Before we get started make a backup of the files pg_hba.conf and postgresql.conf for later use, you will need to use them later to reconstruct the pg11 configs.<\/p><\/blockquote>\n<p><\/strong><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# cp \/data1\/data93\/pg_hba.conf \/root\/\r\n[root@jr-sandbox ~]# cp \/data1\/data93\/postgresql.conf \/root\/\r\n<\/pre>\n<p><em><strong>Use WGET to grab the RPMS from https:\/\/yum.postgresql.org<\/em><\/strong><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox pg_11]# wget https:\/\/yum.postgresql.org\/11\/redhat\/rhel-6-x86_64\/postgresql11-11.2-2PGDG.rhel6.x86_64.rpm\r\n[root@jr-sandbox pg_11]# wget https:\/\/yum.postgresql.org\/11\/redhat\/rhel-6-x86_64\/postgresql11-contrib-11.2-2PGDG.rhel6.x86_64.rpm\r\n[root@jr-sandbox pg_11]# wget https:\/\/yum.postgresql.org\/11\/redhat\/rhel-6-x86_64\/postgresql11-debuginfo-11.2-2PGDG.rhel6.x86_64.rpm\r\n[root@jr-sandbox pg_11]# wget https:\/\/yum.postgresql.org\/11\/redhat\/rhel-6-x86_64\/postgresql11-devel-11.2-2PGDG.rhel6.x86_64.rpm\r\n[root@jr-sandbox pg_11]# wget https:\/\/yum.postgresql.org\/11\/redhat\/rhel-6-x86_64\/postgresql11-docs-11.2-2PGDG.rhel6.x86_64.rpm\r\n[root@jr-sandbox pg_11]# wget https:\/\/yum.postgresql.org\/11\/redhat\/rhel-6-x86_64\/postgresql11-libs-11.2-2PGDG.rhel6.x86_64.rpm\r\n[root@jr-sandbox pg_11]# wget https:\/\/yum.postgresql.org\/11\/redhat\/rhel-6-x86_64\/postgresql11-server-11.2-2PGDG.rhel6.x86_64.rpm\r\n<\/pre>\n<p><strong><em>Install the RPMS for postgres11 that we just downloaded<\/em><\/strong><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox pg_11]# rpm -ivh postgresql11-*\r\nwarning: postgresql11-11.2-2PGDG.rhel6.x86_64.rpm: Header V4 DSA\/SHA1 Signature, key ID 442df0f8: NOKEY\r\nPreparing...                ########################################### [100%]\r\n   1:postgresql11-libs      ########################################### [ 14%]\r\n   2:postgresql11           ########################################### [ 29%]\r\n   3:postgresql11-contrib   ########################################### [ 43%]\r\n   4:postgresql11-devel     ########################################### [ 57%]\r\n   5:postgresql11-server    ########################################### [ 71%]\r\n   6:postgresql11-docs      ########################################### [ 86%]\r\n   7:postgresql11-debuginfo ########################################### [100%]\r\n<\/pre>\n<p><strong><em>We will create the data location for postgres11 where the files will be hardlinked and not copied. You can see the tablespace disk locations and the index locations from the pg9.3 install. Its important to create the new pg11 data directory on the same filesystem since we will be using the &#8211;link parameter and it uses hardlinks which will not traverse filesystems. <\/strong><\/em><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# cd \/data1\/\r\n[root@jr-sandbox data1]# ls -ltr\r\ntotal 12\r\ndrwx------  3 postgres postgres 4096 Apr 16 22:57 ts_index1\r\ndrwx------  3 postgres postgres 4096 Apr 16 22:58 ts_data2\r\ndrwx------ 16 postgres postgres 4096 Apr 16 23:02 data93\r\n[root@jr-sandbox data1]# mkdir data11\r\n[root@jr-sandbox data1]# chown -R postgres:postgres data11\/<\/code>\r\n<\/pre>\n<p><strong><em>We will need to init a postgres database in our new location on disk data11. <\/strong><\/em><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# su - postgres\r\n-bash-4.1$ \/usr\/pgsql-11\/bin\/initdb -D \/data1\/data11\r\nThe files belonging to this database system will be owned by user \"postgres\".\r\nThis user must also own the server process.\r\n\r\nThe database cluster will be initialized with locale \"en_US.UTF-8\".\r\nThe default database encoding has accordingly been set to \"UTF8\".\r\nThe default text search configuration will be set to \"english\".\r\n\r\nData page checksums are disabled.\r\n\r\nfixing permissions on existing directory \/data1\/data11 ... ok\r\ncreating subdirectories ... ok\r\nselecting default max_connections ... 100\r\nselecting default shared_buffers ... 128MB\r\nselecting dynamic shared memory implementation ... posix\r\ncreating configuration files ... ok\r\nrunning bootstrap script ... ok\r\nperforming post-bootstrap initialization ... ok\r\nsyncing data to disk ... ok\r\n\r\nWARNING: enabling \"trust\" authentication for local connections\r\nYou can change this by editing pg_hba.conf or using the option -A, or\r\n--auth-local and --auth-host, the next time you run initdb.\r\n\r\nSuccess. You can now start the database server using:\r\n\r\n    \/usr\/pgsql-11\/bin\/pg_ctl -D \/data1\/data11 -l logfile start\r\n\r\n-bash-4.1$ <\/pre>\n<p><strong><em>Now we are ready to stop pg9.3 and check pg_upgrade compatibility.  pg_upgrade ships with a &#8211;check argument that will check the compatibility of the clusters and be sure the upgrade will work before changing any files. Lets stop pg9.3 and run the pg_upgrade with the &#8211;check parameter.<\/strong><\/em><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# \/etc\/init.d\/postgresql-9.3 stop\r\nStopping postgresql-9.3 service:                           [  OK  ]\r\n\r\n[root@jr-sandbox ~]# su - postgres\r\n\r\n-bash-4.1$ \/usr\/pgsql-11\/bin\/pg_upgrade --link --old-bindir=\/usr\/pgsql-9.3\/bin\/ --new-bindir=\/usr\/pgsql-11\/bin\/ --old-datadir=\/data1\/data93\/ --new-datadir=\/data1\/data11\/ --check\r\nPerforming Consistency Checks\r\n-----------------------------\r\nChecking cluster versions                                   ok\r\nChecking database user is the install user                  ok\r\nChecking database connection settings                       ok\r\nChecking for prepared transactions                          ok\r\nChecking for reg* data types in user tables                 ok\r\nChecking for contrib\/isn with bigint-passing mismatch       ok\r\nChecking for invalid \"unknown\" user columns                 ok\r\nChecking for hash indexes                                   ok\r\nChecking for roles starting with \"pg_\"                      ok\r\nChecking for incompatible \"line\" data type                  ok\r\nChecking for presence of required libraries                 ok\r\nChecking database user is the install user                  ok\r\nChecking for prepared transactions                          ok\r\n\r\n*Clusters are compatible*<\/pre>\n<p><strong><br \/>\n<em>Ok checks have passed and the cluster versions are ready for upgrade, lets run this without the &#8211;check parameter and upgrade postgres.<\/em> <\/strong><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# su - postgres\r\n-bash-4.1$ \/usr\/pgsql-11\/bin\/pg_upgrade --link --old-bindir=\/usr\/pgsql-9.3\/bin\/ --new-bindir=\/usr\/pgsql-11\/bin\/ --old-datadir=\/data1\/data93\/ --new-datadir=\/data1\/data11\/\r\nPerforming Consistency Checks\r\n-----------------------------\r\nChecking cluster versions                                   ok\r\nChecking database user is the install user                  ok\r\nChecking database connection settings                       ok\r\nChecking for prepared transactions                          ok\r\nChecking for reg* data types in user tables                 ok\r\nChecking for contrib\/isn with bigint-passing mismatch       ok\r\nChecking for invalid \"unknown\" user columns                 ok\r\nChecking for roles starting with \"pg_\"                      ok\r\nChecking for incompatible \"line\" data type                  ok\r\nCreating dump of global objects                             ok\r\nCreating dump of database schemas\r\n                                                            ok\r\nChecking for presence of required libraries                 ok\r\nChecking database user is the install user                  ok\r\nChecking for prepared transactions                          ok\r\n\r\nIf pg_upgrade fails after this point, you must re-initdb the\r\nnew cluster before continuing.\r\n\r\nPerforming Upgrade\r\n------------------\r\nAnalyzing all rows in the new cluster                       ok\r\nFreezing all rows in the new cluster                        ok\r\nDeleting files from new pg_xact                             ok\r\nCopying old pg_clog to new server                           ok\r\nSetting next transaction ID and epoch for new cluster       ok\r\nDeleting files from new pg_multixact\/offsets                ok\r\nCopying old pg_multixact\/offsets to new server              ok\r\nDeleting files from new pg_multixact\/members                ok\r\nCopying old pg_multixact\/members to new server              ok\r\nSetting next multixact ID and offset for new cluster        ok\r\nResetting WAL archives                                      ok\r\nSetting frozenxid and minmxid counters in new cluster       ok\r\nRestoring global objects in the new cluster                 ok\r\nRestoring database schemas in the new cluster\r\n                                                            ok\r\nAdding \".old\" suffix to old global\/pg_control               ok\r\n\r\nIf you want to start the old cluster, you will need to remove\r\nthe \".old\" suffix from \/data1\/data93\/global\/pg_control.old.\r\nBecause \"link\" mode was used, the old cluster cannot be safely\r\nstarted once the new cluster has been started.\r\n\r\nLinking user relation files\r\n                                                            ok\r\nSetting next OID for new cluster                            ok\r\nSync data directory to disk                                 ok\r\nCreating script to analyze new cluster                      ok\r\nCreating script to delete old cluster                       ok\r\nChecking for hash indexes                                   ok\r\n\r\nUpgrade Complete\r\n----------------\r\nOptimizer statistics are not transferred by pg_upgrade so,\r\nonce you start the new server, consider running:\r\n    .\/analyze_new_cluster.sh\r\n\r\nRunning this script will delete the old cluster's data files:\r\n    .\/delete_old_cluster.sh\r\n-bash-4.1$ <\/pre>\n<p><strong><em>OK the pg_upgrade code completed successfully and has generated 2 scripts.  One to analyze the new pg11 cluster to get stats for the query planner and vacuum.  The other to cleanup and remove the old pg9.3 locations on disk.  Let&#8217;s start pg11, we will need to create an override file to tell pg11 where the data11 data lives, then we should be able to start postgres and check some things and verify our upgrade.<\/em> <\/strong><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# cd \/etc\/sysconfig\/pgsql\/\r\n[root@jr-sandbox pgsql]# cp postgresql-9.3 postgresql-11\r\n[root@jr-sandbox pgsql]# vim postgresql-11 \r\n[root@jr-sandbox pgsql]# cat postgresql-11 \r\nPGDATA=\/data1\/data11\r\nPGLOG=\/data1\/data11\/pgstartup.log\r\n\r\n[root@jr-sandbox pgsql]# \/etc\/init.d\/postgresql-11 start\r\nStarting postgresql-11 service:                            [  OK  ]\r\n<\/pre>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox pgsql]# su - postgres\r\n-bash-4.1$ ps -ef| grep postgres| head -n 1\r\npostgres 31047     1  0 23:30 ?        00:00:00 \/usr\/pgsql-11\/bin\/postmaster -D \/data1\/data11\r\n-bash-4.1$ psql \r\npsql (11.2)\r\nType \"help\" for help.\r\n\r\npostgres=# select spcname\r\n      ,pg_tablespace_location(oid) \r\nfrom   pg_tablespace;\r\n  spcname   | pg_tablespace_location \r\n------------+------------------------\r\n pg_default | \r\n pg_global  | \r\n index1     | \/data1\/ts_index1\r\n data2      | \/data1\/ts_data2\r\n(4 rows)<\/pre>\n<p><strong><br \/>\n<em>OK we can see we have pg11 running and we can run the generated scripts to cleanup, but lets take a look at the data and index directories to see what the upgrade produced.<\/em> <\/strong><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# cd \/data1\/\r\n[root@jr-sandbox data1]# ls\r\ndata11  data93  ts_data2  ts_index1\r\n[root@jr-sandbox data1]# cd data11\/\r\n[root@jr-sandbox data11]# ls -l\r\ntotal 132\r\ndrwx------ 5 postgres postgres  4096 Apr 16 23:19 base\r\n-rw------- 1 postgres postgres    30 Apr 16 23:30 current_logfiles\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:32 global\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:10 log\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:09 pg_commit_ts\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:09 pg_dynshmem\r\n-rw------- 1 postgres postgres  4513 Apr 16 23:09 pg_hba.conf\r\n-rw------- 1 postgres postgres  1636 Apr 16 23:09 pg_ident.conf\r\ndrwx------ 4 postgres postgres  4096 Apr 16 23:35 pg_logical\r\ndrwx------ 4 postgres postgres  4096 Apr 16 23:19 pg_multixact\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:30 pg_notify\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:09 pg_replslot\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:09 pg_serial\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:09 pg_snapshots\r\n-rw------- 1 postgres postgres   469 Apr 16 23:30 pgstartup.log\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:30 pg_stat\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:45 pg_stat_tmp\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:09 pg_subtrans\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:19 pg_tblspc\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:09 pg_twophase\r\n-rw------- 1 postgres postgres     3 Apr 16 23:09 PG_VERSION\r\ndrwx------ 3 postgres postgres  4096 Apr 16 23:19 pg_wal\r\ndrwx------ 2 postgres postgres  4096 Apr 16 23:19 pg_xact\r\n-rw------- 1 postgres postgres    88 Apr 16 23:09 postgresql.auto.conf\r\n-rw------- 1 postgres postgres 23863 Apr 16 23:09 postgresql.conf\r\n-rw------- 1 postgres postgres    48 Apr 16 23:30 postmaster.opts\r\n-rw------- 1 postgres postgres    95 Apr 16 23:30 postmaster.pid\r\n[root@jr-sandbox data11]# cd ..\/ts_index1\/\r\n[root@jr-sandbox ts_index1]# ls -l\r\ntotal 8\r\ndrwx------ 2 postgres postgres 4096 Apr 16 23:19 PG_11_201809051\r\ndrwx------ 2 postgres postgres 4096 Apr 16 22:57 PG_9.3_201306121\r\n[root@jr-sandbox ts_index1]# cd ..\/ts_data2\/\r\nYou have mail in \/var\/spool\/mail\/root\r\n[root@jr-sandbox ts_data2]# ls -l\r\ntotal 8\r\ndrwx------ 2 postgres postgres 4096 Apr 16 23:19 PG_11_201809051\r\ndrwx------ 2 postgres postgres 4096 Apr 16 22:58 PG_9.3_201306121<\/code>\r\n<strong>\r\n<\/pre>\n<p><em>We can view the shell scripts that pg_upgrade produced and cleanup the old pg9.3 references and run the analyze vacuums.<\/em> <\/strong><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# su - postgres\r\n-bash-4.1$ ls\r\n11  9.3  analyze_new_cluster.sh  delete_old_cluster.sh\r\n-bash-4.1$ cat delete_old_cluster.sh \r\n#!\/bin\/sh\r\n\r\nrm -rf '\/data1\/data93'\r\nrm -rf '\/data1\/ts_index1\/PG_9.3_201306121'\r\nrm -rf '\/data1\/ts_data2\/PG_9.3_201306121'\r\n-bash-4.1$ cat analyze_new_cluster.sh \r\n#!\/bin\/sh\r\n\r\necho 'This script will generate minimal optimizer statistics rapidly'\r\necho 'so your system is usable, and then gather statistics twice more'\r\necho 'with increasing accuracy.  When it is done, your system will'\r\necho 'have the default level of optimizer statistics.'\r\necho\r\n\r\necho 'If you have used ALTER TABLE to modify the statistics target for'\r\necho 'any tables, you might want to remove them and restore them after'\r\necho 'running this script because they will delay fast statistics generation.'\r\necho\r\n\r\necho 'If you would like default statistics as quickly as possible, cancel'\r\necho 'this script and run:'\r\necho '    \"\/usr\/pgsql-11\/bin\/vacuumdb\" --all --analyze-only'\r\necho\r\n\r\n\"\/usr\/pgsql-11\/bin\/vacuumdb\" --all --analyze-in-stages\r\necho\r\n\r\necho 'Done'<\/pre>\n<p><strong><br \/>\n<em>This looks good, lets execute them and cleanup any pg9.3 references as well as remove the pg9.3 rpms.<\/em> <\/strong><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox data1]# su - postgres\r\n-bash-4.1$ .\/delete_old_cluster.sh \r\n-bash-4.1$ .\/analyze_new_cluster.sh \r\nThis script will generate minimal optimizer statistics rapidly\r\nso your system is usable, and then gather statistics twice more\r\nwith increasing accuracy.  When it is done, your system will\r\nhave the default level of optimizer statistics.\r\n\r\nIf you have used ALTER TABLE to modify the statistics target for\r\nany tables, you might want to remove them and restore them after\r\nrunning this script because they will delay fast statistics generation.\r\n\r\nIf you would like default statistics as quickly as possible, cancel\r\nthis script and run:\r\n    \"\/usr\/pgsql-11\/bin\/vacuumdb\" --all --analyze-only\r\n\r\nvacuumdb: processing database \"postgres\": Generating minimal optimizer statistics (1 target)\r\nvacuumdb: processing database \"template1\": Generating minimal optimizer statistics (1 target)\r\nvacuumdb: processing database \"postgres\": Generating medium optimizer statistics (10 targets)\r\nvacuumdb: processing database \"template1\": Generating medium optimizer statistics (10 targets)\r\nvacuumdb: processing database \"postgres\": Generating default (full) optimizer statistics\r\nvacuumdb: processing database \"template1\": Generating default (full) optimizer statistics\r\n\r\nDone\r\n-bash-4.1$<\/pre>\n<p><em><strong>Remove the pg9.3 rpms and references, set the new data location in the .pgsql_profile.<\/strong> <\/em><\/p>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# yum remove postgresql93*\r\nLoaded plugins: fastestmirror\r\nSetting up Remove Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package postgresql93.x86_64 0:9.3.24-1PGDG.rhel6 will be erased\r\n---> Package postgresql93-contrib.x86_64 0:9.3.24-1PGDG.rhel6 will be erased\r\n---> Package postgresql93-debuginfo.x86_64 0:9.3.24-1PGDG.rhel6 will be erased\r\n---> Package postgresql93-devel.x86_64 0:9.3.24-1PGDG.rhel6 will be erased\r\n---> Package postgresql93-docs.x86_64 0:9.3.24-1PGDG.rhel6 will be erased\r\n---> Package postgresql93-libs.x86_64 0:9.3.24-1PGDG.rhel6 will be erased\r\n---> Package postgresql93-server.x86_64 0:9.3.24-1PGDG.rhel6 will be erased\r\n--> Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n===================================================================================================================================================================================================================\r\n Package                                                  Arch                                     Version                                              Repository                                            Size\r\n===================================================================================================================================================================================================================\r\nRemoving:\r\n postgresql93                                             x86_64                                   9.3.24-1PGDG.rhel6                                   @affinity6-prod-db                                   5.3 M\r\n postgresql93-contrib                                     x86_64                                   9.3.24-1PGDG.rhel6                                   @affinity6-prod-db                                   1.7 M\r\n postgresql93-debuginfo                                   x86_64                                   9.3.24-1PGDG.rhel6                                   @affinity6-prod-db                                    28 M\r\n postgresql93-devel                                       x86_64                                   9.3.24-1PGDG.rhel6                                   @affinity6-prod-db                                   6.8 M\r\n postgresql93-docs                                        x86_64                                   9.3.24-1PGDG.rhel6                                   @affinity6-prod-db                                    31 M\r\n postgresql93-libs                                        x86_64                                   9.3.24-1PGDG.rhel6                                   @affinity6-prod-db                                   632 k\r\n postgresql93-server                                      x86_64                                   9.3.24-1PGDG.rhel6                                   @affinity6-prod-db                                    16 M\r\n\r\nTransaction Summary\r\n===================================================================================================================================================================================================================\r\nRemove        7 Package(s)\r\n\r\nInstalled size: 89 M\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\nWarning: RPMDB altered outside of yum.\r\n  Erasing    : postgresql93-debuginfo-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                1\/7 \r\n  Erasing    : postgresql93-devel-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                    2\/7 \r\n  Erasing    : postgresql93-server-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                   3\/7 \r\n  Erasing    : postgresql93-contrib-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                  4\/7 \r\n  Erasing    : postgresql93-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                          5\/7 \r\n  Erasing    : postgresql93-libs-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                     6\/7 \r\n  Erasing    : postgresql93-docs-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                     7\/7 \r\n  Verifying  : postgresql93-debuginfo-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                1\/7 \r\n  Verifying  : postgresql93-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                          2\/7 \r\n  Verifying  : postgresql93-docs-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                     3\/7 \r\n  Verifying  : postgresql93-contrib-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                  4\/7 \r\n  Verifying  : postgresql93-server-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                   5\/7 \r\n  Verifying  : postgresql93-devel-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                    6\/7 \r\n  Verifying  : postgresql93-libs-9.3.24-1PGDG.rhel6.x86_64                                                                                                                                                     7\/7 \r\n\r\nRemoved:\r\n  postgresql93.x86_64 0:9.3.24-1PGDG.rhel6          postgresql93-contrib.x86_64 0:9.3.24-1PGDG.rhel6     postgresql93-debuginfo.x86_64 0:9.3.24-1PGDG.rhel6     postgresql93-devel.x86_64 0:9.3.24-1PGDG.rhel6    \r\n  postgresql93-docs.x86_64 0:9.3.24-1PGDG.rhel6     postgresql93-libs.x86_64 0:9.3.24-1PGDG.rhel6        postgresql93-server.x86_64 0:9.3.24-1PGDG.rhel6       \r\n\r\nComplete!\r\n[root@jr-sandbox ~]# <\/pre>\n<pre class=\"theme:solarized-dark lang:default decode:true \" >\r\n[root@jr-sandbox ~]# cd \/etc\/sysconfig\/pgsql\/\r\nYou have new mail in \/var\/spool\/mail\/root\r\n[root@jr-sandbox pgsql]# ls\r\npostgresql-11  postgresql-9.3\r\n[root@jr-sandbox pgsql]# rm -f postgresql-9.3 \r\n[root@jr-sandbox pgsql]# su - postgres\r\n-bash-4.1$ ls\r\n11  9.3  analyze_new_cluster.sh  delete_old_cluster.sh\r\n-bash-4.1$ rm -rf 9.3<\/pre>\n<p>You can now view the pg_hba.conf and postgresql.conf you saved in \/root and add whats needed to the new pg11 configs.  <\/p>\n<p>That&#8217;s it!! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to share my experience with upgrading postgres database server from major version 9 to 11. I am showing the steps that I took to get many servers in dev and production upgraded with limited disk space(not enough space to copy). I am hoping this will help with the problems I faced when testing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,1],"tags":[71,70,72,69,68,51],"class_list":["post-667","post","type-post","status-publish","format-standard","hentry","category-coding-thoughts","category-general-code","tag-71","tag-70","tag-database","tag-link","tag-pg_upgrade","tag-postgres"],"_links":{"self":[{"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/posts\/667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jasonralph.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=667"}],"version-history":[{"count":42,"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/posts\/667\/revisions"}],"predecessor-version":[{"id":783,"href":"https:\/\/jasonralph.org\/index.php?rest_route=\/wp\/v2\/posts\/667\/revisions\/783"}],"wp:attachment":[{"href":"https:\/\/jasonralph.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jasonralph.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jasonralph.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}