Re: Upgrade 9.2 to 9.6 without modifying the location of the tablespaces

From: Keith <keith(at)keithf4(dot)com>
To: Erik Serrano <eserranos(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Upgrade 9.2 to 9.6 without modifying the location of the tablespaces
Date: 2020-09-29 14:54:31
Message-ID: CAHw75vtsSkR8Eo-LBjk9Jy2c_JjfR-kD4m1WUFNnJ5A_utFp_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Sep 29, 2020 at 9:37 AM Erik Serrano <eserranos(at)gmail(dot)com> wrote:

> I will do a laboratory testing that technique, to see if it works for me.
> Thank you very much! Bruce,
>
>
> *Erik R. Serrano Saavedra*
> *Ingeniero de Sistemas Informáticos*
> * Data Base Administrator*
>
> * eserranos(at)gmail(dot)com <eserranos(at)gmail(dot)com>*
> * 998596691*
>
>
> El mar., 29 sept. 2020 a las 0:03, Bruce Momjian (<bruce(at)momjian(dot)us>)
> escribió:
>
>> On Tue, Sep 29, 2020 at 12:02:02AM -0300, Erik Serrano wrote:
>> > Thank you very much Bruce, I update the binary and the data in this way:
>> >
>> >
>> > bash# /usr/pgsql-9.6/bin/pg_upgrade --old-datadir /var/lib/pgsql/data/
>> > --new-datadir /var/lib/pgsql/9.6/data/ --old-bindir /usr/bin/
>> --new-bindir /usr
>> > /pgsql-9.6/bin/
>> >
>> >
>> > And in that I would like to know if it is essential to move the data?.
>> Remember
>> > that I do not have space on the disks to make a tablespaces move
>> > thank u Bruce
>>
>> Use link mode so you don't need double the disk space.
>>
>> --
>> Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
>> EnterpriseDB https://enterprisedb.com
>>
>> The usefulness of a cup is in its emptiness, Bruce Lee
>>
>>

Just a note that if you do link mode, there is no going back if something
goes wrong since it's using hard links and overwriting your original files.
My general recommendation if using link mode for pg_upgrade is to upgrade a
replica. Then if something goes wrong, you can always go back to your
original primary.

1. Shut down primary
2. Wait for replica to catch up (if needed)
3. Promote replica to stand-alone
4. Perform pg_upgrade on replica system

If all goes well, failover to your replica and when you're confident you
never need to go back to pre-upgrade, you can rebuild your old primary as a
replica.

If you don't have a replica, then I would recommend taking a backup of your
database just before doing the upgrade.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Anthony, Craig Talmadge 2020-09-29 17:40:15 archive_active file.
Previous Message Erik Serrano 2020-09-29 13:39:32 Re: Upgrade 9.2 to 9.6 without modifying the location of the tablespaces