My Windows Server was damaged, I have installed the new OS, PostgreSQL12. The folder \PostgreSQL\12\data is in good state. No database dumps. Is it possible to restore database having the folder?
1 Answer
As long as you're using the same architecture (32-bit vs 64-bit), and it's still on Windows Server, you should be able to use that by copying it to the right location on your new OS's filesystem and start it. Just be prepared for it to take longer to start if the database wasn't shut down cleanly as it will have to replay the transaction logs before coming online.
3 Comments
ZedZip
ok, copy entire folder \data to the new server's folder \data (may be overwrite smth) or some sub-folders only?
Thom Brown
Yes, you need the entire data directory. Although if there's a pre-existing cluster, I guess you can't use the same location. You will need to register a new cluster.
ZedZip
I have no clusters, it is standalone server. Ok, will try and return back