PDA

View Full Version : Importing .sql file to restore my database?



pokrastinator
10-03-2009, 09:13 AM
I tried following the 'backup database' instructions as I was moving my postgresql database to a brand new machine. But I must have made a mistake, because the backup created an .sql file as a result.

When I try to import using pgAdmin it wants to find a .backup file.
I tried renaming my .sql file to a .backup file and importing it but no luck, it seems to recognize its the wrong file type.

Any ideas on how I can recover from this? Unfortunately I have blown away my old machine.

I'd imagine the .sql file contains the raw SQL to re-create my database, but maybe I need to use a different method to import it.

Thx

fozzy71
10-03-2009, 09:58 AM
You used this FAQ?

http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=12


Did you manually change the output file name to .sql when creating it? Do you have the original \data folder from the old postgresql installation? Do you have your old \HMArchive folder of your original hands?

pokrastinator
10-03-2009, 10:20 AM
Thanks for your help.

I had no idea how to do the export, and I believe the link you reference is what I found.
I did not manually change the filename - but I wonder if I accidentally selected an option or checkbox...

I do not have the original /data or /HMArchive folders unfortunately.

I forgot to mention something important: after I complete step 7) in the import procedure in the link you sent my 'OK' button never lights up. So I have never been able to do step 8). I have waited a while (10) minutes to make sure that if pgAdmin parses the file at that time it has a chance to do so. Both 'view' and 'ok' are grayed out.

My user is an admin, on Vista, with UAC turned off.

fozzy71
10-03-2009, 10:36 AM
Thanks for your help.

I had no idea how to do the export, and I believe the link you reference is what I found.
I did not manually change the filename - but I wonder if I accidentally selected an option or checkbox...

That isn't really possible AFAIK.

http://i207.photobucket.com/albums/bb176/fozzy71/HEM/hm-backup1.png


I do not have the original /data or /HMArchive folders unfortunately.

The \HMArchive and your DB exported to text files are WAY more important than making .backup files. backups are never 100% reliable. You should always have copies of the original and exported hands as 2nd and 3rd level backup items.


I forgot to mention something important: after I complete step 7) in the import procedure in the link you sent my 'OK' button never lights up. So I have never been able to do step 8). I have waited a while (10) minutes to make sure that if pgAdmin parses the file at that time it has a chance to do so. Both 'view' and 'ok' are grayed out..

Of course not. It cant do anything with a .SQL file. If you picked a .backup file to restore, it may take a long time to do the restore, where it appears that nothing is happening, but that is a different scenario that only happens when using the proper backup file.

If you do not have a .backup file or a copy of your old \postgresql\8.x\data folder, you must import the original or exported text files to rebuild the DB.

pokrastinator
10-03-2009, 10:42 AM
I found this link about my problem (http://74.125.113.132/search?q=cache:d0z3LIAsmOQJ:archives.postgresql.or g/pgadmin-hackers/2005-02/msg00041.php+postgres+restore+database+ok+button+g rayed&cd=1&hl=en&ct=clnk&gl=ca&client=firefox-a).
It appears I might have a 'plain' format export.

At any rate I'll research some postgresql stuff and see if I can recover.
If not, I'll just have to rebuild my db through grinding.

fozzy71
10-03-2009, 04:14 PM
What sites do you play?

You should be able to email support@yourpokersite and ask them to email you all of your hand histories and tournament summaries so you can import them to HM.