Backup broken PostgreSQL 8.4 without pg_dump
So. I have a problem. PostgreSQL 8.4 won't start or restart without any output given.
But it worked for 3 monthes until hosting provider doesn't rebooted server. Now it is completly broken. It wan't start and doesn't give any output or log.
pg_dump: [archiver (db)] connection to database "postgres" failed: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Now I want to backup (or just start pgsql socket) my database to reinstall postgesql. How?
Soooo. Here is the solution.
The problem was my postgresql (for some reason :o) didn't have any clusters creates.
So I created one:
pg_createcluster 8.4 main
Now let's find something silimar to old data folder: find / -name 'PG_VERSION'
Here it is – /usr/local/pgsql/data/
. Now edit postgresql.conf
in your cluster folder.
You have to replace data_directory
varaible value with old folder.
Now you can restart your server. Everything will work fine.