Page 1 of 1

Variation on needing to move a DB problem

PostPosted: Wed Jul 21, 2010 12:28 am
by zubs1aa
ok, so I'm going on a trip and want to bring PT3 on a drive that I'll bring with me and plug into a different computer.

Currently, I am setup like this:

C:\ PT3. all poker clients etc.

G:\ postgres and the DB's.

So here is my problem: I'm basically taking my C; drive with me and just putting it in a USB housing to plug into the machine on the other end. This means that al I have to do is move postgres and the DB to my c: drive and I'm all set I think.

However, to do that, I need to undo whatever I did that makes PT look over to the G: drive for postgres and the DB, right?

so:
1) How do I undo that re-referencing?
2) I obviously need to just download another copy of postgres and install it on the C; drive right?
3) I also do a backup of the DB and then restore it to the c drive?

which leaves:
4) assuming I got that right in 1-3.... in what order do I perform the steps? I am assuming it is 1,2,3 but plz correct me if I'm wrong. Thanks!

Re: Variation on needing to move a DB problem

PostPosted: Wed Jul 21, 2010 3:11 am
by WhiteRider
Will the drive you're taking with you be the main drive on the computer you are plugging into (i.e. will the OS be running on it), or will it be an external data drive?

Re: Variation on needing to move a DB problem

PostPosted: Wed Jul 21, 2010 4:28 am
by zubs1aa
WhiteRider wrote:Will the drive you're taking with you be the main drive on the computer you are plugging into (i.e. will the OS be running on it), or will it be an external data drive?


haven't decided yet as I could do it either way I think - it depends on what the actual machine setup is. If I can just plug it in as the primary that is probably simplest.. but if it's a much diff pc then it wouldn't make sense to do so and I'd plug it in as a secondary either via USB or sata depending on the situation - which means it could be primary and either internal or external... or secondary and either internal or external. (I'm not going to play as much volume so I'm not going ot wory about speed issues here- plus it's my SSD which is uberfast.)

I'm guessing there are differing answers here? Gimme both bc I'm hopping on a plane Thursday early AM, so I have the day to do whatever I need to do on my end at home prior to leaving. (though I suppose all that would be is putting the backup copy of the DB file on teh drive.)

Re: Variation on needing to move a DB problem

PostPosted: Wed Jul 21, 2010 5:09 am
by WhiteRider
If it is going to be the primary drive then you can just install everything on it normally - that will be the easiest solution from a setup point of view, but would probably be more complicated when using the other computer.
There is a link in the "How To" section of the PostgreSQL FAQ which explains how to set up your database on a hotswap drive, which will probably be your best solution.

Re: Variation on needing to move a DB problem

PostPosted: Wed Jul 21, 2010 4:18 pm
by zubs1aa
WhiteRider wrote:If it is going to be the primary drive then you can just install everything on it normally - that will be the easiest solution from a setup point of view, but would probably be more complicated when using the other computer.
There is a link in the "How To" section of the PostgreSQL FAQ which explains how to set up your database on a hotswap drive, which will probably be your best solution.


ok, but my problem I think is that i currently have a SQL command that redirects the DB to look at the G drive, not the current one (I Forget what command - its buried in teh forums somewhere.) So if I just load postgres and sql onto the C: Drive where PT3 already is... won't it still go looking to the other drive? (I'm NOT rebuilding the drive from scratch)

Re: Variation on needing to move a DB problem

PostPosted: Wed Jul 21, 2010 4:30 pm
by WhiteRider
PT3 will just connect to whatever postgres service is running depending on what port you tell it to connect to. If you install PostgreSQL on a different port on your c: drive then PT3 should be able to connect to that just fine. You may need to backup/restore your database to the new installation. I haven't really done much networking of postgres myself and kraada is on vacation.

Re: Variation on needing to move a DB problem

PostPosted: Wed Jul 21, 2010 4:35 pm
by zubs1aa
WhiteRider wrote:PT3 will just connect to whatever postgres service is running depending on what port you tell it to connect to. If you install PostgreSQL on a different port on your c: drive then PT3 should be able to connect to that just fine. You may need to backup/restore your database to the new installation. I haven't really done much networking of postgres myself and kraada is on vacation.



So if i get this right: When I fire up PT3, the only running Ppostgres service will be on the drive I have, so the junction or table space or whatever that I had created will be ignored?

there is currently no postgres on my c drive... so why do I need a different port? remember, all that is on the drive today is PT3. DB and postgres are elsewhere.

plan was (unless there is an error in my logic here) to 1) install postgres here and then 2) restore the DB here.

Re: Variation on needing to move a DB problem

PostPosted: Wed Jul 21, 2010 4:44 pm
by WhiteRider
Yes, that should be fine. You're right - if you only have one postgres service running it can be on the same port, and this separate installation will ignore any tablespaces you set up in the previous installation.