dbTalk Databases Forums  

Move pgsql data

comp.databases.postgresql comp.databases.postgresql


Discuss Move pgsql data in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Raphael
 
Posts: n/a

Default Move pgsql data - 11-19-2007 , 02:28 AM






Hi,

I am using postgresql 8.1.
The data are in /var/lib/... and the partition is FULL.

How should I do to move the data ? Is it possible just by using a
symbolic link ?

Thanks,
Raphael

Reply With Quote
  #2  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Move pgsql data - 11-19-2007 , 05:18 AM






Raphael <raphperrin (AT) bluewin (DOT) ch> wrote:
Quote:
I am using postgresql 8.1.
The data are in /var/lib/... and the partition is FULL.

How should I do to move the data ? Is it possible just by using a
symbolic link ?
Yes, you can do that. You can move the data directory somewhere else
and replace it with a symbolic link.

A second option would be to enlarge the file system (if possible).

Thirdly, you could just copy the data directory somewhere else and
start the postmaster with 'pg_ctl -D /new/db/location start'.

Mage sure that you retain permissions and ownership when you copy
(cp -p or similar).

Yours,
Laurenz Albe


Reply With Quote
  #3  
Old   
Marco Mariani
 
Posts: n/a

Default Re: Move pgsql data - 11-19-2007 , 07:44 AM



Raphael wrote:

Quote:
How should I do to move the data ? Is it possible just by using a
symbolic link ?
Another option, depending on distribution and usage pattern, could be to
use a separate tablespace for some tables.

http://www.postgresql.org/docs/8.2/s...blespaces.html

If, for instance, you have lots of historical data that you can move to
a slower storage, you can pick some tables and migrate them to that
partition.



Reply With Quote
  #4  
Old   
Raphael
 
Posts: n/a

Default Re: Move pgsql data - 11-19-2007 , 08:34 AM



Marco Mariani a écrit :
Quote:
Raphael wrote:

How should I do to move the data ? Is it possible just by using a
symbolic link ?

Another option, depending on distribution and usage pattern, could be to
use a separate tablespace for some tables.

http://www.postgresql.org/docs/8.2/s...blespaces.html

If, for instance, you have lots of historical data that you can move to
a slower storage, you can pick some tables and migrate them to that
partition.

Ok

Thanks all, I will just move the data and make a symbolic link. I only
have one database for bacula.

Raphael


Reply With Quote
  #5  
Old   
Stefan Braumeister
 
Posts: n/a

Default Re: Move pgsql data - 11-19-2007 , 08:37 AM



Raphael schrieb:
Quote:
Hi,

I am using postgresql 8.1.
The data are in /var/lib/... and the partition is FULL.

How should I do to move the data ? Is it possible just by using a
symbolic link ?

Thanks,
Raphael
One more:

you can add a new harddrive, create a new fstab entry:

/dev/sdx /var/lib/pgsql ext3 ...

Then first temporary mount the new partition mount /dev/sdx
/tmp/newdrive, copy over the data from the olddrive:

cp /var/lib/pgsql/* /tmp/newdrive/

reboot ...

-Stefan


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.