pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Upgrade 9.2 to 9.6 without modifying the location of the tablespaces
7+ messages / 3 participants
[nested] [flat]

* Upgrade 9.2 to 9.6 without modifying the location of the tablespaces
@ 2020-09-29 02:17  Erik Serrano <eserranos@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Erik Serrano @ 2020-09-29 02:17 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hello, I would like to know if there is any way to upgrade from a 9.2 to
9.6 version without modifying the location of the tablespaces since I have
no more disks.
Since one of the actions carried out within an upgrade is the creation of
new clusters and the movement of the data from the old location to the new
location.

Is it possible to perform?

my server data is:
Operating system: linux Red Hat 6.8
base size: 1101 GB
discs :
/dev/sdb1     1008G   713G    245G   75%    /opt/data_postgres
/dev/sdd1       512G   397G      90G   82%    /opt/data_postgres2

Thank you very much in advance.



*Erik R. Serrano Saavedra*

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Upgrade 9.2 to 9.6 without modifying the location of the tablespaces
@ 2020-09-29 02:17  Bruce Momjian <bruce@momjian.us>
  parent: Erik Serrano <eserranos@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Bruce Momjian @ 2020-09-29 02:17 UTC (permalink / raw)
  To: Erik Serrano <eserranos@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org

On Mon, Sep 28, 2020 at 11:17:39PM -0300, Erik Serrano wrote:
> Hello, I would like to know if there is any way to upgrade from a 9.2 to 9.6
> version without modifying the location of the tablespaces since I have no more
> disks. 
> Since one of the actions carried out within an upgrade is the creation of new
> clusters and the movement of the data from the old location to the new
> location.
> 
> Is it possible to perform?
> 
> my server data is:
> Operating system: linux Red Hat 6.8
> base size: 1101 GB
> discs :
> /dev/sdb1     1008G   713G    245G   75%    /opt/data_postgres
> /dev/sdd1       512G   397G      90G   82%    /opt/data_postgres2
> 
> Thank you very much in advance.

Just move the tablespaces before or after the upgrade:

	https://momjian.us/main/blogs/pgblog/2018.html#October_3_2018

There is no way to move them during the upgrade.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Upgrade 9.2 to 9.6 without modifying the location of the tablespaces
@ 2020-09-29 03:02  Erik Serrano <eserranos@gmail.com>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Erik Serrano @ 2020-09-29 03:02 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-admin@lists.postgresql.org

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


*Erik R. Serrano Saavedra*


El lun., 28 sept. 2020 a las 23:17, Bruce Momjian (<bruce@momjian.us>)
escribió:

> On Mon, Sep 28, 2020 at 11:17:39PM -0300, Erik Serrano wrote:
> > Hello, I would like to know if there is any way to upgrade from a 9.2 to
> 9.6
> > version without modifying the location of the tablespaces since I have
> no more
> > disks.
> > Since one of the actions carried out within an upgrade is the creation
> of new
> > clusters and the movement of the data from the old location to the new
> > location.
> >
> > Is it possible to perform?
> >
> > my server data is:
> > Operating system: linux Red Hat 6.8
> > base size: 1101 GB
> > discs :
> > /dev/sdb1     1008G   713G    245G   75%    /opt/data_postgres
> > /dev/sdd1       512G   397G      90G   82%    /opt/data_postgres2
> >
> > Thank you very much in advance.
>
> Just move the tablespaces before or after the upgrade:
>
>         https://momjian.us/main/blogs/pgblog/2018.html#October_3_2018
>
> There is no way to move them during the upgrade.
>
> --
>   Bruce Momjian  <bruce@momjian.us>        https://momjian.us
>   EnterpriseDB                             https://enterprisedb.com
>
>   The usefulness of a cup is in its emptiness, Bruce Lee
>
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Upgrade 9.2 to 9.6 without modifying the location of the tablespaces
@ 2020-09-29 03:03  Bruce Momjian <bruce@momjian.us>
  parent: Erik Serrano <eserranos@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Bruce Momjian @ 2020-09-29 03:03 UTC (permalink / raw)
  To: Erik Serrano <eserranos@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org

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@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Upgrade 9.2 to 9.6 without modifying the location of the tablespaces
@ 2020-09-29 13:39  Erik Serrano <eserranos@gmail.com>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Erik Serrano @ 2020-09-29 13:39 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-admin@lists.postgresql.org

 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@gmail.com <eserranos@gmail.com>*
*                 998596691*


El mar., 29 sept. 2020 a las 0:03, Bruce Momjian (<bruce@momjian.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@momjian.us>        https://momjian.us
>   EnterpriseDB                             https://enterprisedb.com
>
>   The usefulness of a cup is in its emptiness, Bruce Lee
>
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Upgrade 9.2 to 9.6 without modifying the location of the tablespaces
@ 2020-09-29 14:54  Keith <keith@keithf4.com>
  parent: Erik Serrano <eserranos@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Keith @ 2020-09-29 14:54 UTC (permalink / raw)
  To: Erik Serrano <eserranos@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Pgsql-admin <pgsql-admin@lists.postgresql.org>

On Tue, Sep 29, 2020 at 9:37 AM Erik Serrano <eserranos@gmail.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@gmail.com <eserranos@gmail.com>*
> *                 998596691*
>
>
> El mar., 29 sept. 2020 a las 0:03, Bruce Momjian (<bruce@momjian.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@momjian.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.

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Upgrade 9.2 to 9.6 without modifying the location of the tablespaces
@ 2020-09-29 19:45  Erik Serrano <eserranos@gmail.com>
  parent: Keith <keith@keithf4.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Erik Serrano @ 2020-09-29 19:45 UTC (permalink / raw)
  To: Keith <keith@keithf4.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Pgsql-admin <pgsql-admin@lists.postgresql.org>

Thank you very much Keith, The backtracking issue is a great point to
discuss as I work with productive servers.

I'm going to see if it is possible to create a replica, but I don't think
so since there is no availability of having more discs.





*Erik R. Serrano Saavedra*
*Ingeniero de Sistemas Informáticos*
*      Data Base Administrator*

*        eserranos@gmail.com <eserranos@gmail.com>*
*                 998596691*


El mar., 29 sept. 2020 a las 11:55, Keith (<keith@keithf4.com>) escribió:

>
>
> On Tue, Sep 29, 2020 at 9:37 AM Erik Serrano <eserranos@gmail.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@gmail.com <eserranos@gmail.com>*
>> *                 998596691*
>>
>>
>> El mar., 29 sept. 2020 a las 0:03, Bruce Momjian (<bruce@momjian.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@momjian.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.
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2020-09-29 19:45 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 02:17 Upgrade 9.2 to 9.6 without modifying the location of the tablespaces Erik Serrano <eserranos@gmail.com>
2020-09-29 02:17 ` Bruce Momjian <bruce@momjian.us>
2020-09-29 03:02   ` Erik Serrano <eserranos@gmail.com>
2020-09-29 03:03     ` Bruce Momjian <bruce@momjian.us>
2020-09-29 13:39       ` Erik Serrano <eserranos@gmail.com>
2020-09-29 14:54         ` Keith <keith@keithf4.com>
2020-09-29 19:45           ` Erik Serrano <eserranos@gmail.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