pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: How to transfer databases form one server to other
Date: Mon, 27 Jan 2020 05:23:04 -0600
Message-ID: <64a5d084-9e90-738f-3fe3-f0d859312bf1@gmail.com> (raw)
In-Reply-To: <VisenaEmail.11.54410910399c6d03.16fe550d31c@tc7-visena>
References: <VisenaEmail.11.54410910399c6d03.16fe550d31c@tc7-visena>

On 1/26/20 10:44 PM, Andreas Joseph Krogh wrote:
> På mandag 27. januar 2020 kl. 03:26:59, skrev Ron <ronljohnsonjr@gmail.com 
> <mailto:ronljohnsonjr@gmail.com>>:
>
>     [..]
>     I ran *uncompressed* pg_dump on multiple TB+ sized databases from v8.4
>     servers across the LAN using 9.6 binaries on the remote server.  It
>     was quite fast.  Threading was key.
>
> According to the manual: https://www.postgresql.org/docs/12/app-pgdump.html
> the "directory format" is the only format which supports parallel dumps, 
> if I'm not reading it wrong.
> How did threading solve "between database" dump/restore for you? Did you 
> dump to "directory format" first, then restore?

Yes.

> If so, then that requires quite a bit of temp-space...

Correct. The databases are mostly compressed TIFF and PDF images in bytea 
fields, so having Postgres try and compress them again was *slow* and used a 
*lot* of CPU.  Thus, I did uncompressed backups, and that took a *lot* of 
scratch disk space.

(We were not only upgrading Postgres 8.4 to 9.6, but also RHEL 5.10 to 6.10, 
and moving to a geographically distant data center.  Thus, I deemed 
pg_upgrade to be impractical.)

We spun up some VMs with 10 total TB in the same DC as the source (physical) 
servers, and I installed Pg 9.6 on these "intermediate servers", and did 
remote pg_dumps of the 8.4 servers.  Then I installed 9.6 on the VMs in the 
new DC, and NFS mounted the intermediate servers' volumes and ran 
multi-threaded pg_restore on the new servers.  They pulled the data across 
the WAN.

-- 
Angular momentum makes the world go 'round.

view thread (13+ messages)  latest in thread

Message-ID: <64a5d084-9e90-738f-3fe3-f0d859312bf1@gmail.com>
Permalink:  ../64a5d084-9e90-738f-3fe3-f0d859312bf1@gmail.com/
Also on:    postgresql.org/message-id/64a5d084-9e90-738f-3fe3-f0d859312bf1@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: How to transfer databases form one server to other
  In-Reply-To: <64a5d084-9e90-738f-3fe3-f0d859312bf1@gmail.com>
  References: <VisenaEmail.11.54410910399c6d03.16fe550d31c@tc7-visena> <64a5d084-9e90-738f-3fe3-f0d859312bf1@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox