backup postgresql db

Forum with tips, support, etc, on using the PostgreSQL database with Poker Tracker. Please post any PostgreSQL questions here.

backup postgresql db

Postby reusje004 » Fri May 16, 2008 3:01 pm

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
reusje004
 
Posts: 6
Joined: Fri May 16, 2008 2:56 pm

Re: backup postgresql db

Postby reusje004 » Fri May 16, 2008 3:10 pm

nm I just found a topic that might help me, not sure though
reusje004
 
Posts: 6
Joined: Fri May 16, 2008 2:56 pm

Re: backup postgresql db

Postby ptrack pat » Fri May 16, 2008 3:38 pm

ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: backup postgresql db

Postby reusje004 » Sun May 18, 2008 4:39 am

yeah, I hope it will work :/
reusje004
 
Posts: 6
Joined: Fri May 16, 2008 2:56 pm

Re: backup postgresql db

Postby reusje004 » Tue May 20, 2008 1:19 pm

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
reusje004
 
Posts: 6
Joined: Fri May 16, 2008 2:56 pm

Re: backup postgresql db

Postby ptrack pat » Tue May 20, 2008 1:24 pm

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?
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: backup postgresql db

Postby reusje004 » Tue May 20, 2008 2:11 pm

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)
reusje004
 
Posts: 6
Joined: Fri May 16, 2008 2:56 pm

Re: backup postgresql db

Postby ptrack pat » Tue May 20, 2008 3:27 pm

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.
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: backup postgresql db

Postby reusje004 » Tue May 20, 2008 4:38 pm

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 :/
reusje004
 
Posts: 6
Joined: Fri May 16, 2008 2:56 pm

Re: backup postgresql db

Postby ptrack pat » Tue May 20, 2008 4:44 pm

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.
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm


Return to PostgreSQL Forum

Who is online

Users browsing this forum: No registered users and 14 guests

cron
highfalutin