Moving the database cluster

Stop the postgres service

Create the folder for the new cluster and assing as proprietary to the user and group postgres [/home/postgres/data]

Run as postgres user

$ initdb -D /home/postgres/data

Change several things in /etc/postgresql/9.1/main/postgres.cnf:

  • Allowed conexions
  • Data dir to /home ...
more ...