Re: pg_upgrade vs. pg_dump

From: Harshad Adalkonda <adalkondaharshad(at)gmail(dot)com>
To: "Perry, Hemy" <hemy_perry(at)mentor(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_upgrade vs. pg_dump
Date: 2015-01-21 11:15:15
Message-ID: CANnQH_ii=P6L8effp+h4OPA=h8sJ31AJSEnRDz9-S1_WoRfvwA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Jan 21, 2015 at 12:52 AM, Perry, Hemy <hemy_perry(at)mentor(dot)com> wrote:

> Hello,
>
>
>
> I am planning a migration from 9.1.7 to 9.4.0.
>
> Based on my understanding, the recommendation is to use pg_upgrade over
> ‘dump and restore’.
>
> Is that right?
>
>
>
> If I want to use pg_upgrade, I need to provide the -b *bindir (*
> --old-bindir=*bindir) *and so my second question is what if I’ll provide
> 9.4 (the * new* PostgreSQL executable directory) also as the
> ‘old-bindir’, can it work that way? Always?
>
> [I am trying to solve a problem that I might not have the old-bindir
> available on the machine and only the new-bindir will be available (as well
> as the old & new datadir of course J]
>
>
>
> Thanks
>
> Hemy
>
>
>
>
>

Hi,

First Answer:
you can use dump & restore if your database size is small, but if your
database size is huge then you should go for pg_upgrade.
pg_upgrade is fast & time consuming than dump & restore for huge databases.

Second Answer:
pg_upgrade requires old bin & old data directory because pg_upgrade
upgrades headers of old data directory by using old & new binaries.
It converts the old data headers to new one.

If you put new binaries as old bin directory it will not work because the
pg_ctl of 9.4 will look for *postgresql.auto.conf* file in your old data
directory which is required for Postgresql 9.4 to start the old cluster.

I hope you got the pg_upgrade concept.

--
Thanks & Regards,
*Harshad Adalkonda*
*Database Administrator*
www.shreeyansh.com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Vladimir Borodin 2015-01-21 11:19:05 Re: PostgreSQL 9.3 synchronous replication
Previous Message Matheus de Oliveira 2015-01-21 10:37:16 Re: pg_upgrade vs. pg_dump