PDA

View Full Version : Database back-up/restore attempt..



Lefort
01-26-2011, 11:27 PM
Hey guys..

My intentions are to take my desktop database and get it onto my laptop. Note that it's close to a million hands so it's a big db.

I tried doing the backup as shown here: (FAQ - Hold'em Manager Poker Tracking Software :: Backup & Restore Database (http://faq.holdemmanager.com/questions/72/Backup+%26+Restore+Database))

After about 45 minutes-ish I got an error. I don't recall the exact error but will work on getting that. It produced an ~800mb file and I was hoping that it might have still worked (even with the error) but after using the restore process from that same page, the database was empty after the restore (on the laptop).

So then I tried using the Backup/Restore option in the HM software (as opposed to pgAdmin) and got this error immediately: "error: Could not find PostgreSQL installation directory"

Not sure what to do.. :confused: Couldn't find any similar problems from sifting through FAQs and forums.

I'll quote that exact error message I get in pgAdmin asap..

Lefort
01-26-2011, 11:59 PM
"pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: invalid page header in block 40387 of relation "playerhandsflop"
pg_dump: The command was: COPY public.playerhandsflop (playerhand_id, betamount, callamount, calledcbet, raisedcbet, lasttoactonstreet, relativeposition, betpercentofpot, raisepercentofpot, facingraisepercentofpot, facingbetpercentofpot, wascheckraised, unopened, madehandvalue, flushdrawvalue, straightdrawvalue, stackpotratio) TO stdout;
pg_dump: *** aborted because of error"

Patvs
01-27-2011, 07:43 AM
Which SQL version are you using?
Can you vacuum/reindex the database first before you create the .backup file to make sure there are no corruptions in any of the indexes.

If you then get a similar error, reimport the original handhistories instead into a new database on the laptop.

Lefort
01-27-2011, 08:39 AM
PostgreSQL 8.2

I'll try doing that now.

Patvs
01-27-2011, 08:20 PM
You also installed SQL 8.2 on the laptop?

SQL 8.2 is not compatible with 8.4 in case you were trying to restore a 8.2 backup--> to a 8.4 postgres.

Lefort
01-27-2011, 08:43 PM
Vacuuming stopped after ~15 minutes and I got this:


INFO: analyzing "public.playerhandstourneymisc"
INFO: "playerhandstourneymisc": scanned 3000 of 3870 pages, containing 240229 live rows and 0 dead rows; 3000 rows in sample, 309895 estimated total rows
INFO: vacuuming "public.playerhandsflop"

ERROR: invalid page header in block 40387 of relation "playerhandsflop"


The button was still "OK" and not "DONE" so I'm assuming it didn't work?

Patvs
01-27-2011, 09:27 PM
Try a reindex. It currently seems the playerhandsflop index is corrupt.
(so the backup was also corrupt, that's why it wasn't possible to restore it)

Lefort
01-28-2011, 08:43 AM
I ended up just doing all the handhistories instead and that's worked out fine for the most part.. thanks