I'm trying to find a fastest way to move postgresql database v9.1.20 from one server to another server with postgres v9.3.10.
Scenario as follows:
Production server running Ubuntu 12.04 postgresql 9.1.20, database size appox 250g
Target server we are trying to relocate on is Ubuntu 14.04 postgresq 9.3.10.
The very first attempt we are tried to experiment with
was to dump database (pg_dump) from old server and restore
it on the new server (pg_restore).
It has worked just fine but the time we spent to
relocate is about 4 hours (pg_dump takes 3 hours
and pg_restore takes 1 hour (network link 1g,
SSD disks on both servers).
Total downtime in 4 hours is not acceptable.
The next attempt was to use pg_basebackup instead of
pg_dump. The method has reduced backup time up to 40 mins
instead of 3 hours which is acceptable.
However we cannot use dump provided by the pg_basebackup
due to version incompatibility.
I had read many articles on how to provide inplace database upgrade but it seems they are all referring to upgrade on the SAME server.
So my question - how I can upgrade the database backup produced
by the pg_basebackup on the server without having previous
postgresql serve binaries installed?
Thanks.
pg_dumpdirectly into apsql? Something likepg_dump -h host1 dbname | psql -h host2 dbnameBtw: why don't you upgrade to a more recent version like 9.4 or 9.5?