PDA

View Full Version : How to edit the default path of PostreSQL's "data" directory?



attiati
12-11-2009, 12:46 PM
I wanted to move my HM database (20 GB) to another partition.
The postgres backup function doesn't work. And I dont will export-import...

Somebody told me, I should stop the postgres service, and I should edit the "data" path in "postmaster.opts" file, and the "# data_directory =" line in "postgresql.conf". And I should move my data directory to this new place. I did it, but always, when I restart the postgres service, it rewrites always to the original, old path, and it search the data directory at the original place. Why? In which file, or where should I edit more?

fozzy71
12-11-2009, 04:36 PM
Which version of Postgresql? 8.3 that you first installed for HM?

I have never learned/tried that method you describe for moving a \data folder. I reinstall postgresql and move my \data folder where I want it. Then I pick the new data directory location during installation.

Please update to the latest beta - http://www.holdemmanager.com/downloads/HmBetaUpdate.exe

For reinstalling SQL to the same DB, follow these steps:

1) Uninstall PostgreSQL from the Windows Control Panel.
2) If you are moving the DB to a different drive/partition, manually cut or copy the \Postgresql\8.x\data directory to it's new location.
3) run the command - start > programs > accessories > command prompt > right-click > run as administrator

net user postgres /delete
4) reboot.
5) Install the same version of PostgreSQL as your current DB using these instructions - http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=177
6) If you have moved/installed your DB to a non-default location, please make sure to change the 'Data Directory' path during the installation.