From: Paul Förster <paul.foerster@gmail.com>
To: Holger Jakobs <holger@jakobs.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Move base directory to different location
Date: Thu, 26 Nov 2020 15:05:26 +0100
Message-ID: <99166572-4225-4508-ADA6-F002339C2228@gmail.com> (raw)
In-Reply-To: <31b748c7-d728-9d8d-fb49-b6b935b8295b@jakobs.com>
References: <CALhHtcANxVwbRYZYyBtZ4G4jJtm+b4vJgs5vp=8twS-9YWC41Q@mail.gmail.com>
<31b748c7-d728-9d8d-fb49-b6b935b8295b@jakobs.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: paul.foerster@gmail.com, holger@jakobs.com, pgsql-admin@lists.postgresql.org
Subject: Re: Move base directory to different location
In-Reply-To: <99166572-4225-4508-ADA6-F002339C2228@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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