After you checked the owner and permissions there are following reason that prevents postgreSQL from start:
1. CORRUPTED FILES
Perhaps it's not possible to start postgresql because of the full filesystem when using the old data directory.
Also after copying the data directory one ore more files could be corrupt because postmaster wasn't able to store data correct into the file(s) when the filesystem was full.
Solution: Use your backup.
2. CONFIG FILE IN postgresql.conf POINTS TO THE OLD DATA DIR
Please check that no file in /new/datadir/postgresql.conf points to the old data directory.
The most important parameters are:
Code:
#data_directory = 'ConfigDir' # use data in another directory
# (change requires restart)
#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
# (change requires restart)
#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
# (change requires restart)
3. MISSPELLED VARIABLE NAME OR DATA DIRECTORY IN /etc/init/postgresql
Please check right spelling of changed variable names ore content in /etc/init/postgresql
4. STARTING POSTGRESQL WITH THE WRONG COMMAND NAME OR USER
Please start postgreSQL like the system does it at boot time (depending of your distribution).
You didn't wrote the name of your distribution.
On my system (openSuSE 12.2) I have to execute
Code:
/etc/init.d/postgresql start
as user root
or
Code:
systemctl start postgresql.service
The data directory is stored as a variable in an other file ("/etc/sysconfig/postgresql") to avoid changing the init script "/etc/init/postgresql" and loosing the changes after an online update.
Please reply what you did and put the commands and messages as CODE - tags into your post.
To be sure that the owner and permissions are correct please post also the output of
Code:
ls -al /you/new/datadir
Please post the last lines of the youngest logfile (in directory <datadir>/pg_log if not otherwise configured)