If you go to the FAQ, you'll find this: Tutorial: 2 installs of pt3, 1 database, no networking!
Here, I will list an alternative way to accomplish this, based off the competing product's FAQ. User prajna wrote the tutorial above and his method was to install postgresql directly to the usb drive. Here, I will have postgresql installed to each computer, but have only the 'data' directory on the usb drive. I do not claim that this method is better in any way than the previous one outlined. In fact, I encourage any responses in that regard for all of our clairty.
- You already have PT3 and Postgre installed and in use on your main computer.
- You want to be able to use and play with the db on a laptop.
- You want to plug the drive back into the main computer and have all laptop play up-to-date in the db with no other importing.
Steps: (main computer first, then laptop)
- As you should always do before messing with your db, MAKE A BACKUP, just in case stuff goes wrong. Follow the guide for backup here: Backup/Restore with PGAdmin. Put the backup file somewhere safe.
- Stop the postgres service on the main computer. Go to: Control Panel -> Administrative Tools -> Services. Find the PostgreSQL service, double click, and Stop it.
- Copy the 'data' directory to the usb drive. First, navigate to your usb drive (lets assume windows makes it E: for now) and create the folders "Program Files", inside that "PostgreSQL", and inside that "8.3". Leave it open, and navigate another window to your main computers hard drives postgres installation at "C:\Program Files\PostgreSQL\8.3". Copy the "data" directory to the hard drive. Now when you navigate to "E:\Program Files\PostgreSQL\8.3\data" you should see the same contents.
- Make windows assign a consistent drive letter to the usb drive. Control Panel -> Administrative Tools -> Computer Management -> Disk Management. Find the usb drive (we assumed E:), right click, change drive letter and path. I changed it to Z: and we'll use that for this tutorial. After this, no matter what you plug into the computer, even if you have 5 usb drives, this particular drive will always be Z:
- Tell Postgres your new 'data' location. Open the registry editor on the main computer. Start menu -> Run, then type in "regedit". BE CAREFUL HERE, YOU COULD SCREW UP YOUR COMPUTER. In the left pane, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pgsql-8.3. When you find it, in the right pane, open the "ImagePath" entry. Its probably too long for the box for you to read, but, it should be: "C:\Program Files\PostgreSQL\8.3\bin\pg_ctl.exe" runservice -w -N "pgsql-8.3" -D "C:\Program Files\PostgreSQL\8.3\data\" and the end part is what needs to be changed. The part after the "-D" tells postgres where to find the data directory. Simply change the C to Z (or whatever letter you assigned in Step 4) so the end part reads "Z:\Program Files\PostgreSQL\8.3\data\" and the new full ImagePath entry should be "C:\Program Files\PostgreSQL\8.3\bin\pg_ctl.exe" runservice -w -N "pgsql-8.3" -D "Z:\Program Files\PostgreSQL\8.3\data\"
- Restart Postgres on main comp. Start the service the same way you stopped it in Step 2. The status should say "Started". If it doesn't, something went wrong. You can check for errors in Control Panel -> Administrative Tools -> Event Viewer -> Application.
- Test PT3 on main comp. PT3 will still be configured for your database on the main hard drive. You will get an error on PT3 startup and need to change it. In the PT3 menu, go to Database -> Database Management. Click "New". Click "This database already exists" and then "Browse databases". Select your db. Now you should have PT3 working on the main comp, reading from your database off the external hard drive.
- Repeat Steps 4 - 7 on your laptop. If you don't have PT3 and postgres installed on your laptop, do it. Download the full installer with postgres and install as normal. Then repeat the steps above.
*I will put in the same warning as from the original tutorial, and that is, you need to stop the postgres service like in Step 2 each time you remove the usb hard drive. I use the Safely Remove Hardware icon (grey rectangle with green arrow) in the tray next to the clock, and WinXP actually won't allow me to stop the drive before removing it. If you just yank out the USB cable, you may run into problems if you don't stop the postgres service first.
I am not a member of PT3 team, just a user who wrote this. I don't check this forum very frequently. Put discussion in this thread.
Feel free to add this to FAQ if you deem worthy.