I am using OpenGeo Suite and I would like to move the PostgreSQL databases files to a different drive than my operating system. The default location installed by OpenGeo Suite is in the "C:\ProgramData\" directory, but I would like for it to be "F:\db\".

Some websites suggest that the data directory location can be changed by adding -D "F:\db\" to the ImagePath value of the PostgreSQL service key in the registry. However, for me this did not change where PostgreSQL is looking, and I have restarted the service several times. Since OpenGeo customized the service and registry key names, I am afraid that they may have also customized the PostgreSQL service itself to prevent the changing of the data directory.

Does anyone have any knowledge of this?

  • Try setting it in postgresql.conf, which is usually in the data directory itself, so you will have to start postgres with a switch for the path to the data directory. Jan 22, 2015 at 15:37

1 Answer 1


I was able to force PostgreSQL to use the data folder F:\db\ by creating the following batch file (and manually turning PostgreSQL on/off):

start "" /min "C:\<PostregreSQL>\bin\pg_ctl.exe" start -D "F:\db" -w

I found this solution here: http://www.garretwilson.com/blog/2014/03/09/postgresql-management-windows.xhtml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.