Thread: pg_upgrade vs. pg_dump
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
On 20 Jan 2015, at 20:22, Perry, Hemy 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? You can compile the twice versions of PostgreSQL on the same computer and just execute the upgrade with pg_upgrade and the right parameters. > > 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 :)] > > Thanks > Hemy -- Stéphane Wirtel - http://wirtel.be - @matrixise
From: Stéphane Wirtel [mailto:stephane@wirtel.be]
Sent: 20 January 2015 21:24
To: Perry, Hemy
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] pg_upgrade vs. pg_dump
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]
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres
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
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.