2

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?

freyley
  • 145
  • 5
  • 1
    What error messages do you get when you try to start the server? – justarobert Apr 15 '11 at 02: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 00:11

1 Answers1

0

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.

hmallett
  • 2,455
  • 14
  • 26