In step 10 of the pg_upgrade doc at
https://www.postgresql.org/docs/9.6/static/pgupgrade.html, it uses this example for rsyncing the main $PGDATA dir to the standby:
rsync --archive --delete --hard-links --size-only --no-inc-recursive /opt/PostgreSQL/9.5/data \ /opt/PostgreSQL/9.6/data standby.example.com:/opt/PostgreSQL
However when I ran this (substituting /var/lib/pgsql for /opt/PostgreSQL), I found that it put a directory under /var/lib/pgsql/data, and my 9.6/data dir was still empty. Furthermore, what was in /var/lib/pgsql/data appeared to be the old 9.2 contents.
I suspect this is because the "data" directories are two levels below the parent directory specified at the end of the command. When I used the similar command for separate tablespaces, it worked as expected.
When I run the command with the "data" dir, so that I'm just specifying 9.2 and 9.6, it works as desired. eg:
rsync --archive --delete --hard-links --size-only --no-inc-recursive /opt/PostgreSQL/9.5 \ /opt/PostgreSQL/9.6 standby.example.com:/opt/PostgreSQL
FWIW I was upgrading from 9.2.22 to 9.6.6 on CentOS 6.
--