Recovering data from old database

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

Recovering data from old database

Postby ClvrNickname » Mon Sep 15, 2008 9:23 pm

Recently my hard drive died, but before it completely failed I managed to transfer the contents of my PostgreSQL data folder onto a new drive. It is an 8.2 database I was using with PT2. I'm trying to figure out how to get this database to work with PT3, but I don't really know anything about how PostgreSQL works. Would I need to do something like install 8.2 on my new drive, copy over the data folder with my old database, and do some kind of export over to 8.3, or am I totally off here? Any help is appreciated, thanks.
ClvrNickname
 
Posts: 2
Joined: Sat May 24, 2008 6:39 pm

Re: Recovering data from old database

Postby WhiteRider » Tue Sep 16, 2008 5:07 am

You won't be able to use a PT2 database in PT3 at all - you will have to reconnect PT2 to it first.
Copy the data folder to the same place on your new computer and re-install postgres 8.2 onto it, but on the step where it says to 'intialise database cluster' you should uncheck this option (because the database already exists). This should allow you to reconnect PT2.

Once you have PT2 working again, you can convert the DB to PT3 using the Database menu.
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Recovering data from old database

Postby ClvrNickname » Wed Sep 17, 2008 8:05 am

Followup question:

I copied the old database over like you said, but PT2 wouldn't recognize any databases. pgAdmin said the password was incorrect when I tried to connect to the 8.2 server. I don't know if I forgot it (I thought I knew what it was) or if something else is messed up, but I've been trying to work around it. Someone said to add the following to my pg_hba.conf file:

# TYPE DATABASE USER CIDR-ADDRESS METHOD
local all postgres trust

pgAdmin can now connect to the server, but won't let me backup the database files, throwing the following error:

C:\Program Files (x86)\PostgreSQL\8.2\bin\pg_dump.exe -i -h localhost -p 5432 -U postgres -F c -b -v -f "PT2 backup" "POSTGRE2008"
pg_dump: [archiver (db)] connection to database "POSTGRE2008" failed: FATAL: no pg_hba.conf entry for host "::1", user "postgres", database "POSTGRE2008", SSL off
pg_dump: *** aborted because of error

When I try to run PostgreSQL database functions in PT2, I get:

Error #:1
Unable to connect to PostgreSQL (Port#:5432) to get the list of databases. The error was:
101 - SQLSTATE = 08001
FATAL: no pg_hba.conf entry for host "::1", user "postgres" database "template1", SSL off

Any ideas what I need to do to fix this? Could having 8.3 and 8.2 installed at the same time be causing trouble? Thanks.
ClvrNickname
 
Posts: 2
Joined: Sat May 24, 2008 6:39 pm

Re: Recovering data from old database

Postby WhiteRider » Wed Sep 17, 2008 10:59 am

I'm going to move this to the PT2 section and see if Pat can help you get your PT2 database back. Once you have that, you will be able to convert to PT3, but you need to get the PT2 DB restored first.
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Recovering data from old database

Postby ptrack pat » Wed Sep 17, 2008 11:38 am

The last line of the pg_hba.conf file should look exactly like this...if there is a "#" symbol at the very beginning of the line, you need to remove that.

host all all ::1/128 trust
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 2 guests

cron
highfalutin