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: PG9.1 migration to PG9.6, dump/restore issues
Date: Wed, 12 Sep 2018 09:40:19 -0500
Message-ID: <ec058f40-63f1-7d3b-da7b-bc590223674a@gmail.com> (raw)
In-Reply-To: <17082AAFC33A934082836458CB53494374C993BD@MONDB03.na.lzb.hq>
References: <17082AAFC33A934082836458CB53494374C993BD@MONDB03.na.lzb.hq>

On 09/12/2018 08:55 AM, Scot Kreienkamp wrote:
>
> Hi Everyone,
>
> I am working on a migration from PG9.1 to PG9.6.  Hoping some people can 
> chime in on my plans as I am running into some restore issues.
>
> We are upgrading to a new version of PG and migrating to new hardware with 
> RHEL 7, so I am planning on doing a dump and restore to get moved to the 
> new server.  My database is about 300 gigs, not huge but big enough that 
> doing a single threaded dump with multi-threaded restore is going to take 
> too much time for the window of opportunity I’ve been given.  I know I can 
> use multi-threaded restore on PG9.6 using the custom or directory formats, 
> but PG9.1 only supports single threaded dump.  To get around this I’m 
> going to disable all database access to the PG9.1 databases, then use the 
> PG9.6 tools to do a multi-threaded dump and then multi-threaded restore.
>
> These are the commands I was using:
>
> pg_dump -vj 4 -F d -h $OLDSERVER  $DATABASE -f $BACKUPPATH/DATABASE 
> --no-synchronized-snapshots
>
> created $DATABASE
>
> pg_restore -evj 4 -d $DATABASE $BACKUPPATH/$DATABASE   --disable-triggers
>
>

This is almost exactly what I did when migrating from 8.4 to 9.6. As Adrian 
Klaver mentioned, you need to dump the globals and then run that script on 
the new database.

No need to disable triggers, since it's "relevant only when performing a 
data-only restore", and you aren't doing a data-only restore.  Besides, 
pg_restore adds all that metadata -- including PKs, FKs, indexes, etc. to 
the db *after* the data is loaded.


-- 
Angular momentum makes the world go 'round.

view thread (9+ messages)  latest in thread

Message-ID: <ec058f40-63f1-7d3b-da7b-bc590223674a@gmail.com>
Permalink:  ../ec058f40-63f1-7d3b-da7b-bc590223674a@gmail.com/
Also on:    postgresql.org/message-id/ec058f40-63f1-7d3b-da7b-bc590223674a@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: PG9.1 migration to PG9.6, dump/restore issues
  In-Reply-To: <ec058f40-63f1-7d3b-da7b-bc590223674a@gmail.com>
  References: <17082AAFC33A934082836458CB53494374C993BD@MONDB03.na.lzb.hq> <ec058f40-63f1-7d3b-da7b-bc590223674a@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