Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a postgres's data directory from another system, and I'm trying to get it to work enough to dump the data into sql files. Unfortunately, postgresql is broken with the copied in data directory (I realize this isn't the right way to handle this, but I think I'm out of other options.).

From that directory alone, is there any way to get postgres to dump sql files directly, without the server itself being willing to start up? Or do you have other suggestions for how I can get this back to vaguely working?

share|improve this question
1  
What error messages do you get when you try to start the server? –  justarobert Apr 15 '11 at 2:07
    
Regarding other ways, yes there are tons of ways to recover the data assuming you have enough of the information. You need to update the question with what data you have and what data is missing and what errors you are getting when you startup pg or try to load the data. –  polynomial Aug 27 '11 at 0:11

1 Answer 1

up vote 0 down vote accepted

If you have the PGDATA directory from another system, then it's not impossible to copy it to your PostgreSQL server, provided it meets certain requirements, one of which is that it is the same version of PostgreSQL (e.g. don't try and copy the PGDATA from 8.3 to 8.4). I'm not sure if having the same OS and architecture is required, but it would make things simpler.

As for whether PostreSQL can dump data to an SQL file when it won't start, then the answer is no. You need to either get PostgreSQL to start, or recover the data from the file directly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.