PDA

View Full Version : rebuilding a database from data folder



jayceekay
11-22-2008, 01:25 AM
i followed an outdated method for backing up a database, it has worked in the past for me however this time it won't take. i simply copied the data folder to a safe drive, reformatted/reinstalled windows, installed postgresql, stopped the service, and copied the data folder over. this time the postgresql service won't start. when i remove the backed up data folder and then stop/start postgresql it works.

i know this wasn't the proper way to backup but it is the way roy told me to do it in the past (it worked before). is anyone who is more proficient than i am with postgresql know of a possible way to rebuild my old db from this data folder? i've googled around for help however i haven't found squat.

demonseed
11-22-2008, 07:32 AM
+1

I have my data on another one as well. I can't get into my old windows cause it's messed up.

So I only can access to the data folders / postgresql folders but can't start a program because I can't even get into windows.

Would be of great help if somehow this could be done.

morny
11-22-2008, 01:06 PM
Depends, from my limited experience when they dont reconnect its for 2 reasons 1) Different versions of PostgreSQL i.e 8.2 and 8.3 or else the database is corrupt in some way

Its better to also export the HH in case of these scenarios

Theres one other way, Uninstall PostgreSQL and reinstall it, at the path selection stage highlight the data folder and instead of selecting the C:\program files\PostgreSQL\8.x\Data default folder choose the path youve copied the data folder to and then when you get to the installation step where it asks for your password again untick "Initialise database cluster" and it will use the old database. Might return the same result but worth a try