Migrate PostgreSQL Server to New Server With Minimal Downtime using PITR (Point In Time Recovery)
Source Server
mkdir /archive; chown postgres.postgres /archive;
vi /usr/local/postgres/data/postgresql.conf
Add the following lines:
archive_mode = on
archive_command = 'cp -i %p /archive%f'