Sebastian
Sebastian

Reputation: 414

Restoring PostgreSQL database without having a dump just the database files

My hoster upgraded my Ubuntu server and it's not booting any more. The only way I can access my data any more is in read mode via a rescue environment (SSH shell).

I am running a postgres 9.1 installation on the crashed server. I am not able to start the postgres server in the rescue environment. I also do not have a dababase dump created with pg_dump.

However, I was able to copy the whole /var/lib/postgresql folder to a new machine . I installed Postgres 9.1 on this machine. Afertwards I replaced the /var/lib/postgresql with my old files.

When I start the postgres server, I get something like "incorrect checksum in control file".

I there any way to restore the database content without using pg_dump (since I don't have a current dump and I am not able to run it on the defective machine).

Upvotes: 1

Views: 388

Answers (1)

Sebastian
Sebastian

Reputation: 414

Indeed it was an issue between 32bit and 64bit. I had another old server running on 32bit Ubuntu. Initially I tried to restore the data on a 64bit machine. With the 32bit machine it simply worked by copying the postgres main directory. Finally I was able to log into the database and create a dump.

Upvotes: 3

Related Questions