postgresql_upgrade_majort_version

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
postgresql_upgrade_majort_version [2020/01/20 16:01] andonovjpostgresql_upgrade_majort_version [2020/01/26 17:06] (current) – external edit 127.0.0.1
Line 116: Line 116:
 Since we didn't start the new version. Stop the old database version: Since we didn't start the new version. Stop the old database version:
  
-<sxh bah>+<sxh bash>
 -bash-4.2$ /usr/pgsql-9.6/bin/pg_ctl -D /var/lib/pgsql/9.6/data/ stop -bash-4.2$ /usr/pgsql-9.6/bin/pg_ctl -D /var/lib/pgsql/9.6/data/ stop
 waiting for server to shut down.... done waiting for server to shut down.... done
Line 216: Line 216:
 postgres=# postgres=#
 </sxh> </sxh>
 +
 +======Out-Of-Place======
 +Out of place of place upgrade usually is done using one of the following:
 +
 +  * Complete installation of the new PostgreSQL on 2nd host and using pg_dumpall, pg_dump and psql to restore the data
 +  * Using logical replication to minimize the downtime to almost 0.
 +
 +
 +We have two environments:
 +
 +PostgreSQL 9.1 on Linux 5, which should be migrated to:
 +PostgreSQL 10 on Linux 7
 +
 +To migrate from such an old version there are two options
 +
 +
 +  - Upgrade the current version to 10 and simply migrate the data using backup/restore
 +  -  Backup the current version 9.1 using (pg_dumpall and pg_dump) and restore it (pg_restore) to the new version 10
 +
 +Since the first path will take waaay longer and since we are lazy AF, we will be using the second path
 +
 +
 +=====Backup=====
 +In order to backup the data in universal format we have to:
 +
 +  - Dump the globals: Roles & Tablespaces using pg_dumpall
 +  - Dump each database (we will use the custom format "-Fc" since it is more flexible) using pg_dump -Fc
 +
 +So let's get going:
 +
 +===Dump Globals===
 +<sxh bash>
 +
 +
 +
 +</sxh>
 +
  • postgresql_upgrade_majort_version.1579536091.txt.gz
  • Last modified: 2020/01/21 00:01
  • (external edit)