Page 1 of 1

backup postgresql db

PostPosted: Fri May 16, 2008 3:01 pm
by reusje004
Hi,

I just had a virus and I can't boot my windows anymore (also not in safe mode).
I can access my windows disk if I put it in another pc but obviously PT doesn't work like that so I can't use the backupfunction.

Is there another way to backup my db ? Like backing up my postgresql dir or... ?


Thanks,
reusje

Re: backup postgresql db

PostPosted: Fri May 16, 2008 3:10 pm
by reusje004
nm I just found a topic that might help me, not sure though

Re: backup postgresql db

PostPosted: Fri May 16, 2008 3:38 pm
by ptrack pat

Re: backup postgresql db

PostPosted: Sun May 18, 2008 4:39 am
by reusje004
yeah, I hope it will work :/

Re: backup postgresql db

PostPosted: Tue May 20, 2008 1:19 pm
by reusje004
After some hours I finally managed to get it up and running. I can connect to the db in PT.
In PT I can see all the players etc but no stats ? It seems like he forgot the handhistories ?? New handhistories import fine but where are the old ones :(
Image
20k+ players but no data ?

When I select my db in PT I can choose between PTPGSQL1 PTPGSQL2 and POKERDB.
PTPGSQL1 gives an error: error updating the VERSION_INFO table
PTPGSQL2 looks empty
POKERDB looks fine, all players but no data..


Plz help me

Re: backup postgresql db

PostPosted: Tue May 20, 2008 1:24 pm
by ptrack pat
PTPGSQL1 gives an error: error updating the VERSION_INFO table


This means that the VERSION_INFO table is missing. If this is missing, some others may be missing to.

POKERDB looks fine, all players but no data..


It seems like some of the other tables that contain the statistics don't have any data in them.

When did you last backup your databases before you had this virus problem?

Re: backup postgresql db

PostPosted: Tue May 20, 2008 2:11 pm
by reusje004
Thanks for the quick feedback !

I recovered the datafolder after my pc went down so it is the latest data-folder I used. A virus(lsas) will not affect these files and certainly not delete certain tables.

When I open POKERDB in pgAdmin it looks ok (it has 22 tables, incl version_info and contains data).
When I open PTPGSQL1 in pgAdmin I get the error: invalid page header in block 1 of relation "pg_cast" when I click ok I get the same msg for block 0. I can't access 'schemas' or anything.
When I open PTPGSQL2 in pgAdmin it looks ok ( 22 empty tables)

Re: backup postgresql db

PostPosted: Tue May 20, 2008 3:27 pm
by ptrack pat
Using pgAdmin, run the following queries (one at a time) against the POKERDB database...

select count(*) from game ;
select count(*) from game_players ;
select count(*) from session ;

What results do you get from each of these queries?

Hadn't you ever backed up your databases before this? Because if these tables are empty then the only way you are going to get your data back is to restore from an old backup file.

Re: backup postgresql db

PostPosted: Tue May 20, 2008 4:38 pm
by reusje004
select count(*) from game ; -- 440294
select count(*) from game_players ; -- 44
select count(*) from session ; -- 54877


Don't have any 'recent' backups, guess I will have to start a new one :/

Re: backup postgresql db

PostPosted: Tue May 20, 2008 4:44 pm
by ptrack pat
select count(*) from game_players ; -- 44


This is the problem. With 440,000 some game records there should be millions of records in this table.