restoring db on laptop (formerly hosted on dedicated server)

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

restoring db on laptop (formerly hosted on dedicated server)

Postby Russelldust » Wed Oct 05, 2011 3:38 pm

When I play poker at home, I have a dedicated server running PostgreSQL.
PT3 is installed on both my laptop and desktop PC. Whichever computer I use to play poker, it connects to the db on the server. No probs.

Now I want to be able to use PT3's HUD when I play away from home, so I'm trying to copy my database onto my laptop.

* I've used the 'backup' function to back up my db to a zip file on my laptop.
* I've installed PostgreSQL (same version - v8.3) onto my laptop, following the instructions on your website.
* I've created a new database on the local machine (server name localhost) which appears to have worked fine - it's my default/active db.
* I've tried to restore from my backup...

This is where it goes wrong. :(

Code: Select all
-------------------
Databases
-------------------
pt3_db_russelldust Decompressing...Connect Error


My first instinct was that, because I already had a db with that name in Database Management on PT3, it's trying to restore to that db (the one on the dedicated server - which is powered off) instead of restoring to my freshly created db.

So I tried temporarily removing that db from my laptop's db list... but I still get the same problem.

I had a search through your HOWTOs and forum, and now I am under the impression that PT3 does indeed try restore to a db with the same name as the backup - so it either restores to an existing db with that name, OR it creates a new db with that name.

1. Please can you clarify whether I have understood correctly?
2. Do you have any idea why I should get the 'connect error'? Could it be that PT3 is adamantly trying to restore the db to my remote server instead of to my local installation of PostgreSQL? Is the original server name written to the backup along with the db?

(BTW I have checked that this is not a firewall issue - there's nothing untoward in my firewall's event log.)

Please advise! Thanks in advance.
Russelldust
 
Posts: 106
Joined: Thu Jul 24, 2008 2:51 am

Re: restoring db on laptop (formerly hosted on dedicated ser

Postby kraada » Wed Oct 05, 2011 5:36 pm

As far as I know the restoration should not take into account the location of the original server - it should try to restore the database with the name that you have onto the PostgreSQL server that you specify.

Please restart PT3 with Logging Enabled on the laptop, reproduce and report this problem so that we can see if there is more information that is useful in the logs.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: restoring db on laptop (formerly hosted on dedicated ser

Postby Russelldust » Wed Oct 05, 2011 9:43 pm

I ran PT with logging enabled, tried to restore my db, and studied the log...

Code: Select all
2011/10/06 02:02:34.974: [0000133C][PostgresConnection (Error)] Unable to login to database (pt3_db_russelldust). Reason: could not translate host name "XXXXX" to address: Unknown server error


It turns out PT is trying to connect, not to 'localhost' (the default/active db) but to 'XXXXX' which is another db entirely.

So I thought, maybe PT is just upset about the fact I removed XXXXX from my 'hosts' system file. I re-added XXXXX to hosts and re-attempted the db restore.

Code: Select all
2011/10/06 02:20:13.307: [000013B0][PostgresConnection (Error)] Unable to login to database (pt3_db_russelldust). Reason: could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "XXXXX" and accepting TCP/IP connections on port 5432?


Well is doesn't surprise me it can't connect - that server isn't switched on!

Why might it be trying to connect to the server specified in the INACTIVE db, instead of connecting to the ACTIVE db which is on localhost?
Russelldust
 
Posts: 106
Joined: Thu Jul 24, 2008 2:51 am

Re: restoring db on laptop (formerly hosted on dedicated ser

Postby WhiteRider » Thu Oct 06, 2011 3:21 am

I will see if I can get an answer from the development team for you.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: restoring db on laptop (formerly hosted on dedicated ser

Postby WhiteRider » Thu Oct 06, 2011 12:36 pm

The Restore process uses the default PostgreSQL settings (when the "use default" options are ticked on the Restore window) which are stored in the PokerTracker.cfg file, so try updating that.
Close PT3 down and edit the file:
C:\Program Files (x86)\PokerTracker 3\Data\Config\PokerTracker.cfg
(or wherever you have PT3 installed)
..and look for a section like this:

[Database]
Default.Postgres.Server=localhost
Default.Postgres.Port=5432
Default.Postgres.User=postgres
Default.Postgres.Password=dbpass

Change the settings to reflect the server that you want to use and save the file then start PT3 again and try restoring.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: restoring db on laptop (formerly hosted on dedicated ser

Postby Russelldust » Thu Oct 06, 2011 7:04 pm

Aha, now I can see what the problem is... when I perform the restore, one of the first things PT does is it restores the backed up pokertracker.cfg file!!

And of course the backed up pokertracker.cfg file points to the remote server (which is the server containing the database from which I performed the backup).

Incidentally, it's not actually the 'default server' that needs fixing (- this was already set to localhost) - rather it's the server entry for pt3_db_russelldust, which of course at the time of backup pointed to the remote server.

So I guess what PT is doing is, technically, 'correct behaviour'?

I've found I can work around the problem by
1. ensuring 'always prompt before overwrite is enabled'
2. initiating the db restore
3. manually editing the pokertracker.cfg file after it has been restored
4. changing the server back to 'localhost'
5. continuing with the db restore.

Is it essentially a case of "I am doing something a bit odd, and I can expect to have to fudge my config file to get around this" - or do you think it's worth submitting as an 'issue' with the PT3 software?

Thanks for your help.
Russelldust
 
Posts: 106
Joined: Thu Jul 24, 2008 2:51 am

Re: restoring db on laptop (formerly hosted on dedicated ser

Postby WhiteRider » Fri Oct 07, 2011 3:46 am

That makes sense - restoring the PokerTracker.cfg file on a different system can cause some issues when paths (or in this case the PostgreSQL setup) are different.
I will make sure the development team read your post and we'll see what they say about it.
Thanks.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 20 guests

cron