PDA

View Full Version : Restore a database



looserguide
12-23-2008, 12:52 PM
I had a hard drive failure. I was able to recover all data, but all I have is the old ...\postgresql\8.3\data directory and a freshly installed Postgresql.

How can I restore the database?

morny
12-23-2008, 02:49 PM
Hi, if you have installed postgresql again then turn off the service by finding PostgreSQL in the Start Menu and using the Stop Service option. Then delete the \Data folder in the new installation of postgres and copy your backed up \Data folder over. if you can't delete then you may need to reboot.

Then in the PostgreSQL menu click on Start Service and if everything went right you should be able to connect to your old database. Often when you get crashes like this the database is unrepairable and it wont connect to PostgreSQL, to verify if it is corrupt, uninstall and reinstall a fresh new database and if postgreSQL connects to that but not to the copied database then its most likely corrupt