PDA

View Full Version : can't get old DB to open on new PC



BubbleBoy
06-26-2011, 11:29 AM
So I have hard drive with a /postgres/data/ folder that stores my db and that I used on my old windows.

On the new PC I didn't do a good job installing HM/postgres (why is the combo installer not letting me configure anything for postgres, it just installs it on C where no one wants it)

I did this http://faq.holdemmanager.com/questions/368/Move+Database+to+Another+Hard+Drive+or+Partition
(have previously done this successfully on the old PC so I don't think I made a mistake there, also tried various times) to link postgres to the right folder. But I cant start the service after setting the new /data/ directory. It times out.

The old database ran under 8.3, now I got 8.4, is that a problem? How do I get access to the my database?

fozzy71
06-26-2011, 01:34 PM
So I have hard drive with a /postgres/data/ folder that stores my db and that I used on my old windows.

On the new PC I didn't do a good job installing HM/postgres (why is the combo installer not letting me configure anything for postgres, it just installs it on C where no one wants it)

95+% of our customers install the database to the C:\ drive (their only drive) so we simplified the installer for the majority of our customer base. If you need to install to a different partition/drive, you will need to download a standalone postgresql installer.


I did this http://faq.holdemmanager.com/questions/368/Move+Database+to+Another+Hard+Drive+or+Partition
(have previously done this successfully on the old PC so I don't think I made a mistake there, also tried various times) to link postgres to the right folder. But I cant start the service after setting the new /data/ directory. It times out.

This is for moving a database, that is already installed and working, to a new directory. To install an old \data folder to a new machine you need to use the same installer/version that was used to create the database and follow the steps in a different FAQ.

Please update to the latest beta - http://rvgsoftware.fileburst.com/HmBetaUpdate.exe

For reinstalling SQL to the same DB, follow these steps:

1) Uninstall PostgreSQL from the Windows Control Panel.
2) If you are moving the DB to a different drive/partition, manually cut or copy the \Postgresql\8.x\data directory to it's new location.
3) run the command - start > programs > accessories > command prompt > right-click > run as administrator

net user postgres /delete
4) reboot.
5) Install the same version of PostgreSQL as your current DB using these instructions - http://faq.holdemmanager.com/questions/71/Reinstall+PostgreSQL+Preserving+Old+Database
6) If you have moved/installed your DB to a non-default location, please make sure to change the 'Data Directory' path during the installation.

If your old database is 8.3, and was created with our old/original postgresql.zip you will want to use this installer (8.3.7, I think) - http://www.holdemmanager.com/downloads/postgresql.zip

If your database was created with the 8.3.9 one-click installer we sometimes link to customers, you will want to use this installer - http://www.holdemmanager.com/downloads/Postgres_8.3.9-v1.0.7.exe



The old database ran under 8.3, now I got 8.4, is that a problem? How do I get access to the my database?

It is best to use the exact same installer you used originally. If you dont have the same installer you definitely want to have the same major version number, or a slightly higher revision number. If your database was created with 8.3.9 you should definitely not use 8.2, or 8.4, and I would suggest you do not use 8.3.7 or 8.3.8 either.

BubbleBoy
06-26-2011, 03:18 PM
ugh ok

thanks for the detailed steps

Can I have 2 postgres versions / postgres users at the same time? Cause I got one old alltime database and now a fresh one just from this PC onward. (If not possible I guess I could just install a second windows on some spare space and put the configure that with the old stuff cause I wont need both at the time..)

BubbleBoy
06-26-2011, 03:53 PM
oh yeah that worked, now Im happy :):)

fozzy71
06-26-2011, 05:27 PM
ugh ok

thanks for the detailed steps

Can I have 2 postgres versions / postgres users at the same time?.....

If you need/want 2 different versions, yes you can as long as you install one version to Port 5433 instead of the default Port: 5432.


oh yeah that worked, now Im happy :):)

great

BubbleBoy
06-28-2011, 05:36 PM
Ok I got an old (8.3) database and a new (8.4) database. The new 8.4 was installed first and worked on port 5432. Secondly I installed 8.3 on 5433. Now I could connect to the old db again.

However now I can't change back to the new db. Both services are running at the same time, the image paths are set correctly. Can't get back to the old db though.

Now it's kinda strange. pdAdmin, only connects to 8.4 on 5432, but cant connect to 8.3 on 5433. HM can only connect on port 5432 as well, but then finds the old 8.3 database...

how do I get the old db back?

Patvs
06-28-2011, 08:22 PM
Check the registry (with regedit) which port is assigned to PostgreSQL 8.3.
And manually change it in the registry to 5433.

(can be a difficult talk to edit the registry)
Alternatively uninstall PostgreSQL with Revo FREE Uninstaller, then reinstall it.

BubbleBoy
06-29-2011, 06:59 AM
in hkey_local_machine/system/currecntcontrolset/services/pgsql-8.3 or /postgresql-8.4 I don't have anything that looks like a port. where should it be?

Patvs
06-29-2011, 09:40 AM
Computer/HKEY_Current_user/software/pgadminIII/server/

BubbleBoy
06-29-2011, 09:55 AM
its set the way it should be, 8.3 on 5433 and 8.4 on 5432

Patvs
06-29-2011, 12:58 PM
Try uninstalling one of them, if that will enable you to connect to the remaining other PostgreSQL version.

BubbleBoy
06-29-2011, 07:59 PM
I uninstalled the 8.3, HM now finds the new database without any additional configuration. But I dont think I can access the old db anymore.. which is not a huge deal but would be nice to switch between them without installed/uninstalling 8.3.

Patvs
06-29-2011, 08:06 PM
Try importing all the hands in SQL 8.4, so you'll have two SQL 8.4 databases?
Instead of switching between one 8.3, and one 8.4 database.

BubbleBoy
07-01-2011, 10:46 AM
my old db is like 75gb and my alltime 8.3 is like 250gb, I dont think I wanna re-import those :D

Patvs
07-01-2011, 09:44 PM
Delete the files in the PostgreSQL/8.3/data/pg-log.

I wouldn't be surprised if you have 50 GB of files in there. (you can delete all)

BubbleBoy
07-09-2011, 02:16 PM
hehe no sorry I turned off logs long ago :) I got a few years of datamined hands.


still haven't find a good way to quickly switch between accessing an 8.3 and an 8.4 database from the same OS

Patvs
07-09-2011, 02:29 PM
It might be a database corruption in one of the databases.
If you reinstall PostgreSQL to the same port (or delete the postgres user) you run the risk of not being able to access the database at all anymore.

So export your HUD/notes, etc of the database you currently can access. (and backup the database)

Try moving the /data folder of the PostgreSQL you can't connect to, to a different folder. Then reinstall it to that folder.

As a savety, start installing PostgreSQL 9.0.4 to another port. To check if switching between 9.0 and 8.4 does work.