views:

176

answers:

2

Forgot to make a backup. Now I have harddrive with databases and new system with empty postgres. Can I somehow restore databases? by simple copy of files etc?

+2  A: 

If you have the full data directory of your old postgresql system (and if it was the same version, or differing only in a revision number) you can just try to put it in place of your data directory in your new postgresql installation. (Of course, stop postgres server before doing this).

It's basically the same procedure used when upgrading postgresql, when there is no need to do backup-restore.

Edit: As pointed out in the comments, I assume not only same (or almost same) version, but same architecture (32 - 64 bits , Linux - Windows, etc)

leonbloy
Please note that is also has to be the same arch (32- or 64-bit) and I *think* the same platform (Linux, Solaris, Windows, etc.).
Matthew Wood
thx ) it works )
pukipuki
+1  A: 

In addition to the leonbloy's answer, you could try pg_migrator, especially if you need to upgrade from 8.3 to 8.4 (and 9.0 eventually).

Milen A. Radev