Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
postgresql_upgrade_majort_version [2020/01/20 16:01] – andonovj | postgresql_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: | ||
- | < | + | < |
-bash-4.2$ / | -bash-4.2$ / | ||
waiting for server to shut down.... done | waiting for server to shut down.... done | ||
Line 216: | Line 216: | ||
postgres=# | postgres=# | ||
</ | </ | ||
+ | |||
+ | ======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/ | ||
+ | - 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 " | ||
+ | |||
+ | So let's get going: | ||
+ | |||
+ | ===Dump Globals=== | ||
+ | <sxh bash> | ||
+ | |||
+ | |||
+ | |||
+ | </ | ||
+ |