Want to move postgreSQL folder

Experiencing technical difficulties? Think you've found a problem with PokerTracker 3? Report it here.

Moderator: Moderators

Want to move postgreSQL folder

Postby Salats » Tue Jul 24, 2012 6:44 am

Hello. So I have a little problem, my computer is devided in to two partitions. The one I had postgreSQL ran out of space since those hands take up quite a lot of space so I wanted to move it to my other partition. Anyway I googled that I can turn off postgreSQL and then move the folder and then turn it back on. So I did this and now my PT3 is saying it can't find the posgreSQL. I was just wondering if I can fix it so my PT realizes that the folder is moved or is there no way of doing this and I should copy it back in the original partition?

Thank you.
Salats
 
Posts: 127
Joined: Thu Jan 28, 2010 8:59 am

Re: Want to move postgreSQL folder

Postby kraada » Tue Jul 24, 2012 8:36 am

You can't quite move the entire folder and do nothing else - you would want to just move the data subfolder and then you would need to edit the postgresql.conf file and set the line for "data directory" to point to your new location (and make sure there's no # at the front of the line).

Another option is to create a tablespace on the new disk then alter your database to set it to use the new tablespace - that would move an individual database off into your new location. For more on tablespaces and creating them see this post.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Want to move postgreSQL folder

Postby Salats » Tue Jul 24, 2012 2:41 pm

kraada wrote:You can't quite move the entire folder and do nothing else - you would want to just move the data subfolder and then you would need to edit the postgresql.conf file and set the line for "data directory" to point to your new location (and make sure there's no # at the front of the line).

Another option is to create a tablespace on the new disk then alter your database to set it to use the new tablespace - that would move an individual database off into your new location. For more on tablespaces and creating them see this post.


I want to try the first option but I'm not sure where do I have to add the directory

I opened the postgresql.conf file with notepad and this is where I see the "data directory" :
(copied from the file)
________________________________________________________________
#data_directory = 'ConfigDir' # use data in another directory
# (change requires restart)
#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
# (change requires restart)
#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
# (change requires restart)

# If external_pid_file is not explicitly set, no extra PID file is written.
#external_pid_file = '(none)' # write an extra PID file
# (change requires restart)
_________________________________________________________________

Is it in one of these lines where I have to add it? :P Thank you again.


Also, this postgresql.conf file is in the Data subfolder not anywhere else in the PostgreSQL folder. Should this file be in both partitions, in the Data folder that I moved over and the PostgreSQL folder that is now without the Data subfolder?
Salats
 
Posts: 127
Joined: Thu Jan 28, 2010 8:59 am

Re: Want to move postgreSQL folder

Postby kraada » Tue Jul 24, 2012 2:55 pm

Change:
#data_directory = 'ConfigDir' # use data in another directory

To:

data_directory = 'D:\Wherever\The\Data\Folder\is'
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Want to move postgreSQL folder

Postby Salats » Tue Jul 24, 2012 4:15 pm

kraada wrote:Change:
#data_directory = 'ConfigDir' # use data in another directory

To:

data_directory = 'D:\Wherever\The\Data\Folder\is'


Do I delete the "# use data in another directory" that is after this line too? Or do I just add the new directory?


So far what I have done is, moved the Data subfolder from postgreSQL from one partition to the other, so the postgreSQL folder stays where it was before. I opened the postgresql.conf and changed the 'ConfigDir' with 'E:\PostgreSQL DATA\data' which is where the DATA subfolder is. (Did it have to be 'E:\PostgreSQL DATA' or 'E:\PostgreSQL DATA\data' ?)

So I did that tried to turn on pokertracker and got the Configure PostgreSQL Database window, I check the "This database already exists" and click connect and get this error:

"Unable to connect to PostgreSQL database: PT3_2012_07_24_230557
Reason: Unable to login to database (PT3_2012_07_24_230557). Reason: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "???" and accepting TCP/IP connections on port 5432? "
Salats
 
Posts: 127
Joined: Thu Jan 28, 2010 8:59 am

Re: Want to move postgreSQL folder

Postby kraada » Tue Jul 24, 2012 4:54 pm

You can set it to wherever you like, that was just an example. The bit after the # at the end of the line isn't interpreted so it can be left if you prefer.

That error means the server couldn't start though. Click Start, type Event Viewer, and look in the Applications section, what error does it report for PostgreSQL?
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Want to move postgreSQL folder

Postby Salats » Tue Jul 24, 2012 5:36 pm

kraada wrote:You can set it to wherever you like, that was just an example. The bit after the # at the end of the line isn't interpreted so it can be left if you prefer.

That error means the server couldn't start though. Click Start, type Event Viewer, and look in the Applications section, what error does it report for PostgreSQL?


Ok so I checked the error it said

"postgres cannot access the server configuration file "C:/Program Files/PostgreSQL/8.3/data/postgresql.conf": No such file or directory"

that was because I had cut the Data subfolder out and moved it to the other partition. So I made a new blank folder (data) in the postgresql/8.3 folder and copied the postgresql.conf from the place I had moved it to. Now there error in the event viewer says:

"2012-07-24 21:07:58 GMT FATAL: data directory "C:/WINDOWS/system32/E:PostgreSQL DATAdata" does not exist"

Which I guess means that the directory is written wrong or smth?
Salats
 
Posts: 127
Joined: Thu Jan 28, 2010 8:59 am

Re: Want to move postgreSQL folder

Postby kraada » Tue Jul 24, 2012 6:18 pm

You want to only move the base subfolder. Try using two backslashes instead of just one in the path and that may help.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Want to move postgreSQL folder

Postby Salats » Wed Jul 25, 2012 7:08 am

kraada wrote:You want to only move the base subfolder. Try using two backslashes instead of just one in the path and that may help.


Hello again. So I have now just moved the base subfolder to the new directory in the other partition. Everything else is left in the original one. Now the error I got in Event Viewer says:

"2012-07-25 10:41:41 GMT FATAL: data directory "C:/WINDOWS/system32/E:PostgreSQL DATAdata" does not exist"

I tried using two // using \ and two \\ non of those worked. But in the Event Viewer it seems the errors didn't update. Latest I error I got there was this one and it was from earlier, I don't see new errors in the Event Viewer since I tried using different backslashes.

What is interesting is that there is this "Information" not error thing too in the Event Viewer and what it says is: "Timed out waiting for server startup" with Source PostgreSQL too. Anyway when I was doing all this moving of folders and everything I had turned off PostgreSQL from the PostgreSQL folder, there is a Start Service and Stop Service file which I used. Anyway It seems like stopping it worked and it doesn't really start back up. When I click the start service file I get the black window saying: "The PostgreSQL Database Server 8.3 service is starting and it takes longer than usual before the window closes. The information Event says it has timed out and didn't start, so this might be the problem.
Salats
 
Posts: 127
Joined: Thu Jan 28, 2010 8:59 am

Re: Want to move postgreSQL folder

Postby kraada » Wed Jul 25, 2012 8:28 am

Can you paste the exact configuration line as you have it now? The server will time out because it can't find the data directory - that needs to be fixed before anything else can work.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Next

Return to Technical Support / Bug Reports [Read Only]

Who is online

Users browsing this forum: No registered users and 8 guests