pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedPg_upgrade question
8+ messages / 7 participants
[nested] [flat]
* Pg_upgrade question
@ 2010-11-30 22:00 DM <dm.aeqa@gmail.com>
0 siblings, 2 replies; 8+ messages in thread
From: DM @ 2010-11-30 22:00 UTC (permalink / raw)
To: pgsql-general
We are planning to upgrade to 9.01 from 8.4/8.3 version. On my production
Server, there isn't much space left to do a pg_upgrade (Copy),
Can I execute pg_upgrade from new box by pointing to the data directory and
binaries on old box.
Thanks
Deepak
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Pg_upgrade question
@ 2010-11-30 22:08 Devrim GÜNDÜZ <devrim@gunduz.org>
parent: DM <dm.aeqa@gmail.com>
1 sibling, 0 replies; 8+ messages in thread
From: Devrim GÜNDÜZ @ 2010-11-30 22:08 UTC (permalink / raw)
To: DM <dm.aeqa@gmail.com>; +Cc: pgsql-general
On Tue, 2010-11-30 at 14:00 -0800, DM wrote:
> We are planning to upgrade to 9.01 from 8.4/8.3 version. On my
> production Server, there isn't much space left to do a pg_upgrade
> (Copy),
You can use pg_upgrade in link mode -- and AFAIK it uses less extra
space as compared to copy mode:
http://www.postgresql.org/docs/9.0/static/pgupgrade.html
> Can I execute pg_upgrade from new box by pointing to the data
> directory and binaries on old box.
Alternatively, you can use pg_dump of 9.0 to dump the data, and restore
it using psql, since you don't really need pg_upgrade here -- you will
be moving to a new hardware anyway.
Regards,
--
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz
Attachments:
signature.asc (application/pgp-signature, 197B) download
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Pg_upgrade question
@ 2010-12-01 00:52 Vick Khera <vivek@khera.org>
parent: DM <dm.aeqa@gmail.com>
1 sibling, 0 replies; 8+ messages in thread
From: Vick Khera @ 2010-12-01 00:52 UTC (permalink / raw)
To: pgsql-general
On Tue, Nov 30, 2010 at 5:00 PM, DM <dm.aeqa@gmail.com> wrote:
> Can I execute pg_upgrade from new box by pointing to the data directory and
> binaries on old box.
If you're moving to a new box anyway, you might as well just do the
traditional pg_dump and restore.
^ permalink raw reply [nested|flat] 8+ messages in thread
* pg_upgrade question
@ 2020-12-21 21:03 Lu, Dan <Dan.Lu@sig.com>
0 siblings, 1 reply; 8+ messages in thread
From: Lu, Dan @ 2020-12-21 21:03 UTC (permalink / raw)
To: pgsql-general
Hi PostgreSQL Admin,
I am trying to find out if there is any step by step instruction to reconcile old data dir and upgraded data dir after using "-link" option to do an upgrade.
I ran this to do an upgrade from 11.5 to 12.1: pg_upgrade -d /hostname/pg/dev115/data -D /hostname/pg/dev121upg/data --link -b /pgdbadevbal800/pg/PostgreSQL-11.5/bin -B /pgdbadevbal800/pg/PostgreSQL-12.1/bin -p 1432 -P 2432 -v
postgresdbad:dev115:pgdbadevbal800:> pwd
/hostname/pg
postgresdbad:dev115:pgdbadevbal800:> du -sh dev121upg
2.3G dev121upg
postgresdbad:dev115:pgdbadevbal800:> du -sh dev115
22G dev115
My goal is to be able to do an in place upgrade from 11.5 to 12.1 using the same data dir "/hostname/pg/dev115/data". Without the "-link" option I need to double up the space usage for the instance. What is the easiest way to accomplish this task?
Thanks so much for your help.
Dan
________________________________
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pg_upgrade question
@ 2020-12-22 08:20 Paul Förster <paul.foerster@gmail.com>
parent: Lu, Dan <Dan.Lu@sig.com>
0 siblings, 0 replies; 8+ messages in thread
From: Paul Förster @ 2020-12-22 08:20 UTC (permalink / raw)
To: Lu, Dan <Dan.Lu@sig.com>; +Cc: pgsql-general
Hi Dan,
> I am trying to find out if there is any step by step instruction to reconcile old data dir and upgraded data dir after using “—link” option to do an upgrade.
>
> I ran this to do an upgrade from 11.5 to 12.1: pg_upgrade -d /hostname/pg/dev115/data -D /hostname/pg/dev121upg/data --link -b /pgdbadevbal800/pg/PostgreSQL-11.5/bin -B /pgdbadevbal800/pg/PostgreSQL-12.1/bin -p 1432 -P 2432 –v
>
> postgresdbad:dev115:pgdbadevbal800:> pwd
> /hostname/pg
>
> postgresdbad:dev115:pgdbadevbal800:> du -sh dev121upg
> 2.3G dev121upg
>
> postgresdbad:dev115:pgdbadevbal800:> du -sh dev115
> 22G dev115
>
> My goal is to be able to do an in place upgrade from 11.5 to 12.1 using the same data dir “/hostname/pg/dev115/data”. Without the “—link” option I need to double up the space usage for the instance. What is the easiest way to accomplish this task?
>
> Thanks so much for your help.
after a successful upgrade, you may delete the dev115 directory and move the dev121upg directory in its place. That's how I usually do it. Something like this example:
(DB = cluster name)
/data/pg/DB/db <= PGDATA old
/data/pg/DB/dbnew <= PGDATA new, do the initdb here!
initdb -k -D /data/pg/DB/dbnew ...
pg_upgrade -d /data/pg/DB/db -D /data/pg/DB/dbnew ...
pg_ctl -D /data/pg/DB/dbnew stop
rm -rf /data/pg/DB/db
mv /data/pg/DB/dbnew /data/pg/DB/db
pg_ctl -D /data/pg/DB/db start
Your milage may vary. Use at your own risk. ;-)
If you shut down a PostgreSQL cluster properly, you can then easily move PGDATA to virtually any place you want and start it there because PostgreSQL doesn't keep references to absolute paths anywhere.
Cheers,
Paul
^ permalink raw reply [nested|flat] 8+ messages in thread
* pg_upgrade question
@ 2021-12-02 16:05 Alan Stange <stange@rentec.com>
0 siblings, 1 reply; 8+ messages in thread
From: Alan Stange @ 2021-12-02 16:05 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Hello all,
We're running a 13.x installation and looking to upgrade to 14.1. This
is all on Linux servers. We have a main instance running with a number
of hot standby replicas configured. In the past, we have done a
dump/restore on a slow evening and then rsynced all the bits around so
that the main server and all replicas were identical at the start. The
database has gotten larger now (~1TB) so that is a less desirable option.
So I am thinking to do a pg_upgrade --link on each of the main and the
hot standby replicas, and then restarting all the processes. I'm sure
this will work fine on the main server, but I have not seen any mention
of this working in the expected way on the hot standby replicas. Can
someone confirm that the steps I described here will work in the way I
am optimistically expecting it will?
I should mention that we are running on ZFS, and will take a snapshot
prior to the upgrade, so that if something goes sideways with our use of
--link we can revert back instantly.
Thank you,
Alan
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pg_upgrade question
@ 2021-12-02 16:10 Adrian Klaver <adrian.klaver@aklaver.com>
parent: Alan Stange <stange@rentec.com>
0 siblings, 1 reply; 8+ messages in thread
From: Adrian Klaver @ 2021-12-02 16:10 UTC (permalink / raw)
To: Alan Stange <stange@rentec.com>; pgsql-general@lists.postgresql.org
On 12/2/21 08:05, Alan Stange wrote:
> Hello all,
>
> We're running a 13.x installation and looking to upgrade to 14.1. This
> is all on Linux servers. We have a main instance running with a number
> of hot standby replicas configured. In the past, we have done a
> dump/restore on a slow evening and then rsynced all the bits around so
> that the main server and all replicas were identical at the start. The
> database has gotten larger now (~1TB) so that is a less desirable option.
>
> So I am thinking to do a pg_upgrade --link on each of the main and the
> hot standby replicas, and then restarting all the processes. I'm sure
> this will work fine on the main server, but I have not seen any mention
> of this working in the expected way on the hot standby replicas. Can
> someone confirm that the steps I described here will work in the way I
> am optimistically expecting it will?
Have you looked at steps 9 & 11 here?:
https://www.postgresql.org/docs/current/pgupgrade.html
>
> I should mention that we are running on ZFS, and will take a snapshot
> prior to the upgrade, so that if something goes sideways with our use of
> --link we can revert back instantly.
>
> Thank you,
>
> Alan
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: pg_upgrade question
@ 2021-12-02 16:45 Alan Stange <stange@rentec.com>
parent: Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 0 replies; 8+ messages in thread
From: Alan Stange @ 2021-12-02 16:45 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general@lists.postgresql.org
Of course that would be in the manual ;-) Thank you for pointing this
out. We've been doing upgrades the reliable old school way for so long
that I wasn't aware that something better was already well documented.
Thank you,
Alan
On 12/2/21 11:10, Adrian Klaver wrote:
> On 12/2/21 08:05, Alan Stange wrote:
>> Hello all,
>>
>> We're running a 13.x installation and looking to upgrade to 14.1. This
>> is all on Linux servers. We have a main instance running with a number
>> of hot standby replicas configured. In the past, we have done a
>> dump/restore on a slow evening and then rsynced all the bits around so
>> that the main server and all replicas were identical at the start. The
>> database has gotten larger now (~1TB) so that is a less desirable option.
>>
>> So I am thinking to do a pg_upgrade --link on each of the main and the
>> hot standby replicas, and then restarting all the processes. I'm sure
>> this will work fine on the main server, but I have not seen any mention
>> of this working in the expected way on the hot standby replicas. Can
>> someone confirm that the steps I described here will work in the way I
>> am optimistically expecting it will?
> Have you looked at steps 9 & 11 here?:
>
> https://www.postgresql.org/docs/current/pgupgrade.html
>
>> I should mention that we are running on ZFS, and will take a snapshot
>> prior to the upgrade, so that if something goes sideways with our use of
>> --link we can revert back instantly.
>>
>> Thank you,
>>
>> Alan
>>
>>
>
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2021-12-02 16:45 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-30 22:00 Pg_upgrade question DM <dm.aeqa@gmail.com>
2010-11-30 22:08 ` Devrim GÜNDÜZ <devrim@gunduz.org>
2010-12-01 00:52 ` Vick Khera <vivek@khera.org>
2020-12-21 21:03 pg_upgrade question Lu, Dan <Dan.Lu@sig.com>
2020-12-22 08:20 ` Re: pg_upgrade question Paul Förster <paul.foerster@gmail.com>
2021-12-02 16:05 pg_upgrade question Alan Stange <stange@rentec.com>
2021-12-02 16:10 ` Re: pg_upgrade question Adrian Klaver <adrian.klaver@aklaver.com>
2021-12-02 16:45 ` Re: pg_upgrade question Alan Stange <stange@rentec.com>
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