0

I'm trying to move my postgres database from one location on disk to another (Windows 10, btw).

One of the first things I need to do is change postgresql.conf to set the data_directory variable. But when I go to that file I see:

The default values of these variables are driven from the -D command-line option or 
PGDATA environment variable, represented here as ConfigDir.

#data_directory = 'ConfigDir' # use data in another directory # (change requires restart)

So that's commented out. So I went to the command to start postgresql as a service, and by looking at its properties found that there's a parameter in there that sets the data directory:

"C:\Program Files\PostgreSQL\14\bin\pg_ctl.exe" runservice -N "postgresql-x64-14" -D "<this is the actual current path to the postgresql data directory>" -w

But it's only shown in a dialog in a field that I can't edit:

enter image description here

So how can I change that path to point it to the new data directory?

1 Answer 1

1

This seems to be related to modifying the path to the executable of a Windows service ,for which an answer is provided here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.