From: Bruce Momjian Date: Wed, 13 Sep 2017 13:11:28 +0000 (-0400) Subject: docs: improve pg_upgrade standby instructions X-Git-Tag: REL9_6_6~69 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b3327ef2762bf6753ccd5bee75a4935a09bd0a1;p=postgresql docs: improve pg_upgrade standby instructions This makes it clear that pg_upgrade standby upgrade instructions should only be used in link mode, adds examples, and explains how rsync works with links. Reported-by: Andreas Joseph Krogh Discussion: https://postgr.es/m/VisenaEmail.6c.c0e592c5af4ef0a2.15e785dcb61@tc7-visena Backpatch-through: 9.5 --- diff --git a/doc/src/sgml/ref/pgupgrade.sgml b/doc/src/sgml/ref/pgupgrade.sgml index f497eda4b8..40563cfbda 100644 --- a/doc/src/sgml/ref/pgupgrade.sgml +++ b/doc/src/sgml/ref/pgupgrade.sgml @@ -423,10 +423,12 @@ pg_upgrade.exe If you have Streaming Replication (see ) or Log-Shipping (see ) standby servers, follow these steps to - upgrade them. You will not be running pg_upgrade - on the standby servers, but rather rsync on the - primary. Do not start any servers yet. + linkend="warm-standby">) standby servers, and used link mode, + follow these steps to upgrade them. You will not be running + pg_upgrade on the standby servers, but rather + rsync on the primary. Do not start any servers yet. + If you did not use link mode, skip the instructions in + this section and simply recreate the standby servers. @@ -482,9 +484,11 @@ pg_upgrade.exe Run <application>rsync</> - From a directory on the primary server that is above the old and - new database cluster directories, run this on the - primary for each standby server: + When using link mode, standby servers can be quickly upgraded using + rsync. To accomplish this, from a directory on + the primary server that is above the old and new database cluster + directories, run this on the primary for each standby + server: rsync --archive --delete --hard-links --size-only old_pgdata new_pgdata remote_dir @@ -492,30 +496,44 @@ rsync --archive --delete --hard-links --size-only old_pgdata new_pgdata remote_d where - What rsync does is to copy files from the - primary to the standby, and, if pg_upgrade's - If you have tablespaces, you will need to run a similar - rsync command for each tablespace directory. If you - have relocated pg_xlog outside the data directories, - rsync must be run on those directories too. + rsync command for each tablespace directory, e.g.: + + +rsync --archive --delete --hard-links --size-only /vol1/pg_tblsp/PG_9.5_201510051 \ + /vol1/pg_tblsp/PG_9.6_201608131 standby.example.com:/vol1/pg_tblsp + + + If you have relocated pg_xlog outside the data + directories, rsync must be run on those directories + too.