Move data files to different disk ?

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

Move data files to different disk ?

Postby Parket » Fri Jan 13, 2012 5:18 am

I still have my database files just in the normal install directory of PostgreSQL on my C-drive. As I recently plugged in an extra disk, it's worthwhile for both performance and free disk space to move my database to the new disk.
Is this just a matter of moving the 'data' directory to the new disk, and then changing some configuration file of PostgreSQL ? If so, what config do I need to adapt ?
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Move data files to different disk ?

Postby kraada » Fri Jan 13, 2012 9:11 am

The easiest way to do this is actually to uninstall PostgreSQL, move the data file onto the separate disk, then reinstall PostgreSQL and in the reinstallation choose the target as that separate disk in the location so your data folders match up - then PostgreSQL will use that data folder and everything will be stored on your secondary drive.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Move data files to different disk ?

Postby Parket » Fri Jan 13, 2012 10:01 am

Ok thanks. I'll use the opportunity to upgrade to 9.0 as well then.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Move data files to different disk ?

Postby Parket » Fri Jan 13, 2012 12:08 pm

I realized that just dumping the 8.3 data files in the 9.0 directory was probably a bit risky, so I created an empty database and used Backup/Restore to populate the 9.0 database on the new disk.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Move data files to different disk ?

Postby kraada » Fri Jan 13, 2012 12:25 pm

Well that wouldn't be risky so much as it just wouldn't work - 9.0 can't read 8.3 database files. But the method you used works in that case.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 35 guests

cron
highfalutin