pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Move base directory to different location
13+ messages / 5 participants
[nested] [flat]

* Move base directory to different location
@ 2020-11-26 12:59  Yambu <hyambu@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Yambu @ 2020-11-26 12:59 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Hello

May i know the procedure of moving the base directory from
/var/lib/pgsql/10/data/base to another location?

regards

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

* Re: Move base directory to different location
@ 2020-11-26 14:00  Holger Jakobs <holger@jakobs.com>
  parent: Yambu <hyambu@gmail.com>
  0 siblings, 3 replies; 13+ messages in thread

From: Holger Jakobs @ 2020-11-26 14:00 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

It is no problem to move the base directory.

 1. stop the database server
 2. move the base directory as a whole to some other location
    mv /var/lib/pgsql/10/data/base /some/other/location
 3. create a symbolic link pointing to the new location
    cd /var/lib/pgsql/10/data
    ln -s /some/other/location/base .
 4. start the database server

BTW, an upgrade to a newer major version would be a good idea.

Regards,

Holger

Am 26.11.20 um 13:59 schrieb Yambu:
> Hello
>
> May i know the procedure of moving the base directory from 
> /var/lib/pgsql/10/data/base to another location?
>
> regards

-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012

Attachments:

  OpenPGP_signature (application/pgp-signature, 202B) download

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

* Re: Move base directory to different location
@ 2020-11-26 14:05  Paul Förster <paul.foerster@gmail.com>
  parent: Holger Jakobs <holger@jakobs.com>
  2 siblings, 1 reply; 13+ messages in thread

From: Paul Förster @ 2020-11-26 14:05 UTC (permalink / raw)
  To: Holger Jakobs <holger@jakobs.com>; +Cc: pgsql-admin@lists.postgresql.org

Hi Holger,

> On 26. Nov, 2020, at 15:00, Holger Jakobs <holger@jakobs.com> wrote:
> 
> It is no problem to move the base directory.
> 
> 	• stop the database server
> 	• move the base directory as a whole to some other location
> mv /var/lib/pgsql/10/data/base /some/other/location
> 	• create a symbolic link pointing to the new location
> cd /var/lib/pgsql/10/data
> ln -s /some/other/location/base .
> 	• start the database server
> BTW, an upgrade to a newer major version would be a good idea.

why not just move the whole database and NOT create a symlink? Then just start the database in the new PGDATA? Of course you'd need to reconfigure your PGDATA in this case but I consider it more clean than running a database cluster on a symlink.

Cheers,
Paul




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

* Re: Move base directory to different location
@ 2020-11-26 14:06  Pepe TD Vo <pepevo@yahoo.com>
  parent: Holger Jakobs <holger@jakobs.com>
  2 siblings, 1 reply; 13+ messages in thread

From: Pepe TD Vo @ 2020-11-26 14:06 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>; Holger Jakobs <holger@jakobs.com>

Morning Holdger,
since you are mentioning "upgrade to a newer major version", would you please share step by step how to do it in replica?  I have tried to migrate  v.11 to 12 before and failed to upgrade.
v/r,

Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love, and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success

 

    On Thursday, November 26, 2020, 09:00:48 AM EST, Holger Jakobs <holger@jakobs.com> wrote:  
 
  
It is no problem to move the base directory.
    
   - stop the database server
   - move the base directory as a whole to some other location   
 mv /var/lib/pgsql/10/data/base /some/other/location
   - create a symbolic link pointing to the new location   
 cd /var/lib/pgsql/10/data   
 ln -s /some/other/location/base .
   - start the database server
 
BTW, an upgrade to a newer major version would be a good idea.
 
Regards,
 
Holger
 
 Am 26.11.20 um 13:59 schrieb Yambu:
  
 
Hello 
  May i know the procedure of moving the base directory from /var/lib/pgsql/10/data/base to another location? 
  regards  -- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012   

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

* Re: Move base directory to different location
@ 2020-11-26 14:25  Holger Jakobs <holger@jakobs.com>
  parent: Paul Förster <paul.foerster@gmail.com>
  0 siblings, 0 replies; 13+ messages in thread

From: Holger Jakobs @ 2020-11-26 14:25 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi Paul,

You are perfectly correct. I just answered very specific to the question.

Regards,

Holger

Am 26.11.20 um 15:05 schrieb Paul Förster:
> Hi Holger,
>
>> On 26. Nov, 2020, at 15:00, Holger Jakobs <holger@jakobs.com> wrote:
>>
>> It is no problem to move the base directory.
>>
>> 	• stop the database server
>> 	• move the base directory as a whole to some other location
>> mv /var/lib/pgsql/10/data/base /some/other/location
>> 	• create a symbolic link pointing to the new location
>> cd /var/lib/pgsql/10/data
>> ln -s /some/other/location/base .
>> 	• start the database server
>> BTW, an upgrade to a newer major version would be a good idea.
> why not just move the whole database and NOT create a symlink? Then just start the database in the new PGDATA? Of course you'd need to reconfigure your PGDATA in this case but I consider it more clean than running a database cluster on a symlink.
>
> Cheers,
> Paul
>
-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012

Attachments:

  OpenPGP_signature (application/pgp-signature, 202B) download

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

* Re: Move base directory to different location
@ 2020-11-26 14:27  Holger Jakobs <holger@jakobs.com>
  parent: Pepe TD Vo <pepevo@yahoo.com>
  0 siblings, 0 replies; 13+ messages in thread

From: Holger Jakobs @ 2020-11-26 14:27 UTC (permalink / raw)
  To: Pepe TD Vo <pepevo@yahoo.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Have a look here: 
https://info.crunchydata.com/blog/how-to-perform-a-major-version-upgrade-using-pg_upgrade-in-postgre...

I couldn't write it any better.


Am 26.11.20 um 15:06 schrieb Pepe TD Vo:
> Morning Holdger,
>
> since you are mentioning "upgrade to a newer major version", would you 
> please share step by step how to do it in replica?  I have tried to 
> migrate  v.11 to 12 before and failed to upgrade.
>
> v/r,
>
>
> **
> *Bach-Nga
>
> *No one in this world is pure and perfect. If you avoid people for 
> their mistakes you will be alone. So judge less, love, and forgive 
> more.EmojiEmojiEmoji
> To call him a dog hardly seems to do him justice though in as much as 
> he had four legs, a tail, and barked, I admit he was, to all outward 
> appearances. But to those who knew him well, he was a perfect 
> gentleman (Hermione Gingold)
>
> **Live simply **Love generously **Care deeply **Speak kindly.
> *** Genuinely rich *** Faithful talent *** Sharing success
>
>
>
>
> On Thursday, November 26, 2020, 09:00:48 AM EST, Holger Jakobs 
> <holger@jakobs.com> wrote:
>
>
> It is no problem to move the base directory.
>
>  1. stop the database server
>  2. move the base directory as a whole to some other location
>     mv /var/lib/pgsql/10/data/base /some/other/location
>  3. create a symbolic link pointing to the new location
>     cd /var/lib/pgsql/10/data
>     ln -s /some/other/location/base .
>  4. start the database server
>
> BTW, an upgrade to a newer major version would be a good idea.
>
> Regards,
>
> Holger
>
> Am 26.11.20 um 13:59 schrieb Yambu:
> Hello
>
> May i know the procedure of moving the base directory from 
> /var/lib/pgsql/10/data/base to another location?
>
> regards
> -- 
> Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012

-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012

Attachments:

  OpenPGP_signature (application/pgp-signature, 202B) download

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

* Re: Move base directory to different location
@ 2020-11-26 14:30  David G. Johnston <david.g.johnston@gmail.com>
  parent: Holger Jakobs <holger@jakobs.com>
  2 siblings, 1 reply; 13+ messages in thread

From: David G. Johnston @ 2020-11-26 14:30 UTC (permalink / raw)
  To: Holger Jakobs <holger@jakobs.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Please don‘t top-post.

On Thursday, November 26, 2020, Holger Jakobs <holger@jakobs.com> wrote:

>
>
>
> BTW, an upgrade to a newer major version would be a good idea.
>
>
>
Why?

David J.

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

* Re: Move base directory to different location
@ 2020-11-26 14:37  Paul Förster <paul.foerster@gmail.com>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Paul Förster @ 2020-11-26 14:37 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Holger Jakobs <holger@jakobs.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Hi David,

> On 26. Nov, 2020, at 15:30, David G. Johnston <david.g.johnston@gmail.com> wrote:
> 
> Why?

it is always a good idea to stay mostly current (at least with minor versions!), not for new features but for security and bug fixes. For example, I will update 11.9 and 12.4 to 11.10 and 12.5 in our company in the next few days because of some serious CVEs.

Unfortunately, I can't migrate to 13 by now because applications have not been certified yet. :-(

Cheers,
Paul




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

* Move base directory to different location
@ 2020-11-26 14:49  David G. Johnston <david.g.johnston@gmail.com>
  parent: Paul Förster <paul.foerster@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: David G. Johnston @ 2020-11-26 14:49 UTC (permalink / raw)
  To: Paul Förster <paul.foerster@gmail.com>; +Cc: Holger Jakobs <holger@jakobs.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Thursday, November 26, 2020, Paul Förster <paul.foerster@gmail.com>
wrote:

> Hi David,
>
> > On 26. Nov, 2020, at 15:30, David G. Johnston <
> david.g.johnston@gmail.com> wrote:
> >
> > Why?
>
> it is always a good idea to stay mostly current (at least with minor
> versions!), not for new features but for security and bug fixes. For
> example, I will update 11.9 and 12.4 to 11.10 and 12.5 in our company in
> the next few days because of some serious CVEs.
>
> Unfortunately, I can't migrate to 13 by now because applications have not
> been certified yet. :-(


But the comment was to full upgrade, not just update.  The OP didn’t state
which patch release but is running version 10.

David J.

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

* Re: Move base directory to different location
@ 2020-11-26 14:56  Paul Förster <paul.foerster@gmail.com>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Paul Förster @ 2020-11-26 14:56 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Holger Jakobs <holger@jakobs.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Hi David,

> On 26. Nov, 2020, at 15:49, David G. Johnston <david.g.johnston@gmail.com> wrote:
> 
> But the comment was to full upgrade, not just update.  The OP didn’t state which patch release but is running version 10.

IMHO, the same applies to major versions.

Also, it's IMHO easier to get problems fixed if you use a current version because developers don't have to check old code but can work and test with a current version. And if you have a real problem, then you most likely won't get a backward compatible patch. It will rather be fixed in the next release.

As always, after an update/upgrade is before an update/upgrade. :-)

Cheers,
Paul




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

* Re: Move base directory to different location
@ 2020-11-26 15:38  David G. Johnston <david.g.johnston@gmail.com>
  parent: Paul Förster <paul.foerster@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: David G. Johnston @ 2020-11-26 15:38 UTC (permalink / raw)
  To: Paul Förster <paul.foerster@gmail.com>; +Cc: Holger Jakobs <holger@jakobs.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Thu, Nov 26, 2020 at 7:56 AM Paul Förster <paul.foerster@gmail.com>
wrote:

> Hi David,
>
> > On 26. Nov, 2020, at 15:49, David G. Johnston <
> david.g.johnston@gmail.com> wrote:
> >
> > But the comment was to full upgrade, not just update.  The OP didn’t
> state which patch release but is running version 10.
>
> IMHO, the same applies to major versions.
>
> Also, it's IMHO easier to get problems fixed if you use a current version
> because developers don't have to check old code but can work and test with
> a current version. And if you have a real problem, then you most likely
> won't get a backward compatible patch. It will rather be fixed in the next
> release.
>
> As always, after an update/upgrade is before an update/upgrade. :-)
>
>
IMHO, that is all a load of nonsense.

5 years of support is just that, and it is done quite well - the trade-off
of upgrading only in order to make the developer's lives marginally easier
isn't a good one.  Plus, they have to check the old code anyway since most
likely such fixes will need to be back-patched.

The few behavior changes that don't get back-patched support not upgrading
to the newest release ASAP, not doing so sooner.

And if a such non-batchpatch-able fix is recently discovered it won't be
available until the next major release anyway, so even those running
cutting-edge wouldn't see a difference compared to running an prior version.

David J.

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

* Re: Move base directory to different location
@ 2020-11-26 15:41  Paul Förster <paul.foerster@gmail.com>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Paul Förster @ 2020-11-26 15:41 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Holger Jakobs <holger@jakobs.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Hi David,

> On 26. Nov, 2020, at 16:38, David G. Johnston <david.g.johnston@gmail.com> wrote:
> IMHO, that is all a load of nonsense.

do whatever you like.

Cheers,
Paul




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

* Re: Move base directory to different location
@ 2020-11-26 15:44  David G. Johnston <david.g.johnston@gmail.com>
  parent: Paul Förster <paul.foerster@gmail.com>
  0 siblings, 0 replies; 13+ messages in thread

From: David G. Johnston @ 2020-11-26 15:44 UTC (permalink / raw)
  To: Paul Förster <paul.foerster@gmail.com>; +Cc: Holger Jakobs <holger@jakobs.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Thu, Nov 26, 2020 at 8:41 AM Paul Förster <paul.foerster@gmail.com>
wrote:

> Hi David,
>
> > On 26. Nov, 2020, at 16:38, David G. Johnston <
> david.g.johnston@gmail.com> wrote:
> > IMHO, that is all a load of nonsense.
>
> do whatever you like.
>
>
You as well, but you are doing the project a dis-service by recommending to
others to perform unnecessary upgrades when the support policies for the
PostgreSQL project neither require it, nor do most users benefit from doing
so.

David J.

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


end of thread, other threads:[~2020-11-26 15:44 UTC | newest]

Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 12:59 Move base directory to different location Yambu <hyambu@gmail.com>
2020-11-26 14:00 ` Holger Jakobs <holger@jakobs.com>
2020-11-26 14:05   ` Paul Förster <paul.foerster@gmail.com>
2020-11-26 14:25     ` Holger Jakobs <holger@jakobs.com>
2020-11-26 14:06   ` Pepe TD Vo <pepevo@yahoo.com>
2020-11-26 14:27     ` Holger Jakobs <holger@jakobs.com>
2020-11-26 14:30   ` David G. Johnston <david.g.johnston@gmail.com>
2020-11-26 14:37     ` Paul Förster <paul.foerster@gmail.com>
2020-11-26 14:49       ` David G. Johnston <david.g.johnston@gmail.com>
2020-11-26 14:56         ` Paul Förster <paul.foerster@gmail.com>
2020-11-26 15:38           ` David G. Johnston <david.g.johnston@gmail.com>
2020-11-26 15:41             ` Paul Förster <paul.foerster@gmail.com>
2020-11-26 15:44               ` David G. Johnston <david.g.johnston@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