Thread: Recover lost database from DATA folder

Recover lost database from DATA folder

From
"Rohit Prakash Khare"
Date:
I created few tables in one of my PostgreSQL database, but because of some connection
problems I uninstalled it.  have a DATA folder of my previous PostgreSQL installation. I want to use this directory on
anew computer where I have presently installed PostgreSQL.  

I am using PostgreSQL 8.1 and pgAdminIII 1.4.3 on Windows XP. I want that the database in my previous DATA file should
getattached to the new pg AdminIII. I have not got any backup of the database, but only the DATA folder is left. 

Is there any way?

....
Rohit.




 Sign Up for your FREE eWallet at www.wallet365.com


Re: Recover lost database from DATA folder

From
Richard Huxton
Date:
Rohit Prakash Khare wrote:
> I created few tables in one of my PostgreSQL database, but because of some connection
> problems I uninstalled it.  have a DATA folder of my previous PostgreSQL installation. I want to use this directory
ona new computer where I have presently installed PostgreSQL.  
>
> I am using PostgreSQL 8.1 and pgAdminIII 1.4.3 on Windows XP. I want that the database in my previous DATA file
shouldget attached to the new pg AdminIII. I have not got any backup of the database, but only the DATA folder is left. 
>
> Is there any way?

If you have *all* the required files:
1. Stop PostgreSQL
2. Replace the existing data directory with your backup
3. Make sure the owner/permissions are correct.
4. Start PostgreSQL
5. Check the logs

This assumes your data directory was backed up while PostgreSQL was
stopped, otherwise there will probably be problems.

--
   Richard Huxton
   Archonet Ltd