Page 1 of 1

Move data files to different disk ?

PostPosted: Fri Jan 13, 2012 5:18 am
by Parket
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 ?

Re: Move data files to different disk ?

PostPosted: Fri Jan 13, 2012 9:11 am
by kraada
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.

Re: Move data files to different disk ?

PostPosted: Fri Jan 13, 2012 10:01 am
by Parket
Ok thanks. I'll use the opportunity to upgrade to 9.0 as well then.

Re: Move data files to different disk ?

PostPosted: Fri Jan 13, 2012 12:08 pm
by Parket
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.

Re: Move data files to different disk ?

PostPosted: Fri Jan 13, 2012 12:25 pm
by kraada
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.