PDA

View Full Version : Had drive formatted and want to recover DB



GatorJH
03-23-2011, 10:20 PM
I recently had my hard drive crash and my IT department had to re-format. Fortunately they were able to save most of my data files so I would like, if possible to recover my database. One thing that I have noticed is that the first subdirectory under PostgreSQL is 8.4 now, but is 8.3 in the old files. I am guessing that is because I have a newer version of the DB and hopefully that won't make it impossible to recover.

Any help would be greatly appreciated.

olliepower
03-24-2011, 01:04 AM
Hi,

I noted your problem and have notified our support staff to look into your issue.

Patvs
03-24-2011, 12:19 PM
Reinstall PostgreSQL 8.3 (since 8.4 is not compatible with your old 8.3 backup).

During installation, select the /data folder containing your old database.
If your PostgreSQL server won't run (or the installation won't finish) when you select the data folder containing your old database. 9 out of 10 times, this is because there was a corruption in one of the indexes in the old database. And it will be impossible to connect to it / retrieve notes from it.

1 out of 10 times, you can still connect to it, by moving the database folder to a non-Program Files subfolders first. For example move everything to C:/PostgreSQL. And reinstall to that location instead. Also select a different port number when you do this. (5433)

If during the installation of PostgreSQL you don't get the chance to select the location of the data folder, and select a new port (because it will auto-detect the old info), uninstall PostgreSQL first with Revo Uninstaller (free version)..... because it's essential all the old registry keys with the old info are deleted from your system's registry.

Or manually search for the keys in your registry with the old /data folder and port info and delete them.