5

I moved postgresql's data directory by following the following steps:

  1. Stop postgres
  2. cp -a source_data_directory destination_data_directory
  3. export PGDATA=destination_data_directory
  4. Changing data directory to destination_data_directory within postgresql.conf
  5. pg_ctl start

But when I run: "pg_ctl start" I get the following error. Can someone please help me figure out the error.

server starting postgres@Server:/usr/lib/postgresql/9.1/bin$ postgres cannot access the server configuration file "/home/destination_data_directory/postgresql.conf": No such file or directory

asked May 19, 2013 at 5:43

1 Answer 1

1

First make sure the file exists really in that location. Run ls $PGDATA if there is a mistake in the environment variable you will either see the wrong files or get an error because the path does not exist.

Then make sure the owner of the parent directory /home/destination_data_directory and all directories and files under match the user you start pg_ctl under. If they are not either use

su postgres_user

to switch to the right user before running pg_ctl or use

chown -R postgres_user /home/destination_data_directory

to change the owner of the directory and everything under it.

answered May 19, 2013 at 6:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.