PDA

View Full Version : Copy/Paste data folder from postgres doesn't backup.



hemstock
05-24-2010, 07:49 AM
My windows crashed and all I could do was save the Postgres 8.4 folder from my C: drive which includes the data folder. After a format and re-install I am trying to copy paste the data folder so that I can backup the database. I do this by stopping the service, copying the old data folder to the new postgresql folder and then trying to start the service again. However this does not work as I am getting the "error 1053: The service did not respond to the start or control request in a timely fashion". This is not an issue before I change the folders. If I swap the folders again the service starts fine with the new data folder.

I already tried this guide here http://forums.holdemmanager.com/manager-general/8261-still-cant-connect-posgresql-try.html but it didn't work. Would appreciate any help

Edit: I am using windows 7 64bit so the folder for postgress is C:\Program Files (x86)\PostgreSQL. Don't know if that's relevant

hemstock
05-24-2010, 11:35 AM
I don't know why this isn't working but the data folder is from version 8.4 (which was installed automatically together with holdem manager). I tried downloading version 8.4 and installing it manually after a clean uninstall and when the installer asks where to save the database I point to the data folder. The installer says it recognizes that folder and will use it. However after the installation I can't start the service no matter what I do.

Is the postgresql version exactly 8.4 or do I need anything else like 8.4.1, 8.4.2 etc (i installed back in February so I'm not sure what version of postgres that bundle had in). The data folder which I saved says 8.4 in PG_VERSION so I don't know why this isn't working.

Sarek
05-24-2010, 12:16 PM
if both are 8.4 - it should recognize old database
try this:
copy "old" data folder to new Postgre
go there and delete this files
postmaster.opts
postmaster.pid (if exists)
postgresql.bak

hemstock
05-24-2010, 12:32 PM
Ok after several hours of trying everything I found the solution.

When you move the old data folder into the new postgresSql folder make sure to give that folder permissions for users (postgres user obviously) to have full control of that folder. In windows 7 right click on the folder -> Security Tab -> Select Users from the list (which obviously includes postgres user) -> click Edit -> Choose Users again and click Full Control.