Page 1 of 1

Problem moving posgres database

PostPosted: Sat Sep 22, 2012 1:11 pm
by cristi13
Hi, i tried moving postgres database from one hard drive to another. I moved only the "data" folder, leaving "postgres.conf" file in the original folder and modifying the "data_directory" in it. Unfortunately, it didn't work and i get the error: "Error connecting to default databse. Please select one of the valid databases below or create a new one". I gave up and moved the data folder back to its original location. I reverted "postgres.conf" to default and when i try launching PT i get the same error as before.
I also tried creating a new database and i get the error: "Unable to create PostgreSQL database: PT3_2012_09_22_201015
Reason: Unable to login to database (template1). Reason: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "???" and accepting TCP/IP connections on port 5432? "
Right now i just want PT to function normally.
Thank you.

Re: Problem moving posgres database

PostPosted: Sat Sep 22, 2012 1:36 pm
by kraada
Go into Start -> Control Panel -> Administrative Tools -> Event Viewer. In the Application section on the left do you see errors listed for PostgreSQL? If so click on them and tell me what the text says.

Re: Problem moving posgres database

PostPosted: Sat Sep 22, 2012 1:51 pm
by cristi13
There is quite a lot of them but they are not that recent. They are from the last time i was running an import and using PT succesfuly. This is the last one: 2012-09-22 02:45:12 EESTERROR: duplicate key value violates unique constraint "hhs-unique_hand_no"
2012-09-22 02:45:12 EESTCONTEXT: COPY holdem_hand_summary, line 1: "3935964 200 1 4716 12131521595 2012/09/21 23:43:54 2012/09/22 02:45:12 6 3 3 2 10.96 9.96 9.96 8.96 ..."
2012-09-22 02:45:12 EESTSTATEMENT: COPY holdem_hand_summary FROM STDIN;

Re: Problem moving posgres database

PostPosted: Sat Sep 22, 2012 2:13 pm
by cristi13
Is it an option to just reinstall postgres, create a new database, and import the old one into it?

Re: Problem moving posgres database

PostPosted: Sat Sep 22, 2012 2:28 pm
by kraada
That's an option though you'd need to reimport your hands - you can't import a database from a data directory.

If you're going to do that you're better off just reinstalling PostgreSQL to the location you wanted to move things to, then reimport.

Re: Problem moving posgres database

PostPosted: Sat Sep 22, 2012 2:36 pm
by cristi13
But how do i reimport the hands? I have a large database and no longer have the hands in the original format, only the ones in the database.

Re: Problem moving posgres database

PostPosted: Sat Sep 22, 2012 3:39 pm
by kraada
That would be a problem then. The log line you reported to me doesn't sound like it came from Event Viewer - are you sure you were looking in Event Viewer and not in the Postgres log folder?

Re: Problem moving posgres database

PostPosted: Sat Sep 22, 2012 4:03 pm
by cristi13
Yes, i am sure. In the Event Viewer, Application section.
I don't know much about this kind of stuff, but this is strange. It seems is not only a problem with the database (i have 2 of them in PT3 by the way + 1 for holdem manager and in postgres folder i have 2 subfolders: 8.3 and 8.4, currently version 8.4 is installed) Neither of the databases work, nor creating a new one. The only things i have changed are: moving the "data" folder and modiying postgresql.conf, then revert the operation.
So if i reinstall postgresql right now, will i lose my old hands? I don't really care about very old hands, only latest 3 months for Party. I don't know what's with that "processed" folder in PT but hands from the latest 2 months are not there.

Re: Problem moving posgres database

PostPosted: Sun Sep 23, 2012 8:24 am
by kraada
If you were using HEM it's possible they moved those hands elsewhere - you'd need to check in their software to see where the hands were moved.

Re-running the installer with your current data folder in its proper location will not eliminate your data; only starting with a new clean data folder will eliminate your data.