Thread: Move PGdata to a different drive

Move PGdata to a different drive

From
Jennifer Trey
Date:
Hi,

What file should I be working with?

Thanks in advance / Jennifer

Re: Move PGdata to a different drive

From
Bruce Momjian
Date:
Jennifer Trey wrote:
> Hi,
> What file should I be working with?

Just shut down the server and move the directory whever you want and
restart the server.  There are no file contents that need changing.  Of
course should adjust your scripts or PGDATA environment variable.

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

  + If your life is a hard drive, Christ can be your backup. +

Re: Move PGdata to a different drive

From
Jennifer Trey
Date:
Ook.. thats what I wanted to know. I figured there has to be a place to change the pointer to the new location of the data.

Thank you / Jennifer

On Thu, Jun 4, 2009 at 6:11 PM, Bruce Momjian <bruce@momjian.us> wrote:
Jennifer Trey wrote:
> Hi,
> What file should I be working with?

Just shut down the server and move the directory whever you want and
restart the server.  There are no file contents that need changing.  Of
course should adjust your scripts or PGDATA environment variable.

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

 + If your life is a hard drive, Christ can be your backup. +

Re: Move PGdata to a different drive

From
"Massa, Harald Armin"
Date:
Probably you do not have any script to start PostgreSQL, but it is started as a service.

The data directory is a parameter of the service within services.msc, there is
... pg_ctl.exe ... -D "<your drive>":\your\directory"

Read up on pg_ctl --help how to change this information

(pg_ctl --register)

Best wishes,

HArald



On Thu, Jun 4, 2009 at 5:13 PM, Jennifer Trey <jennifer.trey@gmail.com> wrote:
Ook.. thats what I wanted to know. I figured there has to be a place to change the pointer to the new location of the data.

Thank you / Jennifer


On Thu, Jun 4, 2009 at 6:11 PM, Bruce Momjian <bruce@momjian.us> wrote:
Jennifer Trey wrote:
> Hi,
> What file should I be working with?

Just shut down the server and move the directory whever you want and
restart the server.  There are no file contents that need changing.  Of
course should adjust your scripts or PGDATA environment variable.

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

 + If your life is a hard drive, Christ can be your backup. +




--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
no fx, no carrier pigeon
-
LASIK good, steroids bad?

Re: Move PGdata to a different drive

From
David Fetter
Date:
On Thu, Jun 04, 2009 at 11:11:29AM -0400, Bruce Momjian wrote:
> Jennifer Trey wrote:
> > Hi,
> > What file should I be working with?
>
> Just shut down the server and move the directory whever you want and
> restart the server.  There are no file contents that need changing.
> Of course should adjust your scripts or PGDATA environment variable.

Another way to do this is to mount the drive at the place where PGDATA
used to be.  The down side of this approach is that it only works if
you want your PGDATA at the root of that new drive.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Re: Move PGdata to a different drive

From
Yaroslav Tykhiy
Date:
David Fetter wrote:
> On Thu, Jun 04, 2009 at 11:11:29AM -0400, Bruce Momjian wrote:
>> Jennifer Trey wrote:
>>> Hi,
>>> What file should I be working with?
>> Just shut down the server and move the directory whever you want and
>> restart the server.  There are no file contents that need changing.
>> Of course should adjust your scripts or PGDATA environment variable.
>
> Another way to do this is to mount the drive at the place where PGDATA
> used to be.  The down side of this approach is that it only works if
> you want your PGDATA at the root of that new drive.

And of course one can create a safety symlink to the new location of
PGDATA from the old location just in case, e.g., if one suspects
hidden references to PGDATA location in home-made scripts etc.  Of
course, that had better be straightened out sooner than later and the
safety symlink removed for the sake of clarity, but when you need to
get everything rolling *ASAP*, temporary symlinks can be helpful.

Yar

Re: Move PGdata to a different drive

From
Jasen Betts
Date:
On 2009-06-05, David Fetter <david@fetter.org> wrote:
> On Thu, Jun 04, 2009 at 11:11:29AM -0400, Bruce Momjian wrote:
>> Jennifer Trey wrote:
>> > Hi,
>> > What file should I be working with?
>>
>> Just shut down the server and move the directory whever you want and
>> restart the server.  There are no file contents that need changing.
>> Of course should adjust your scripts or PGDATA environment variable.
>
> Another way to do this is to mount the drive at the place where PGDATA
> used to be.  The down side of this approach is that it only works if
> you want your PGDATA at the root of that new drive.

linux (2.4 and later) can mount paths using --bind

That is, you can use mount like a symlink (except unlike a symlink the mounted
directories are still there after chroot)






>
> Cheers,
> David.
> --
> David Fetter <david@fetter.org> http://fetter.org/
> Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
> Skype: davidfetter      XMPP: david.fetter@gmail.com
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>