PDA

View Full Version : Connect to an exixting database



jelozano
07-31-2011, 03:03 PM
I have a local network with 2 computers on it.

In my #1 pc I have created a hem2 database importing all my hand histories.

I usually access #1pc db on my #2 pc over the local network, but the problem is that when i enter the database window in #2pc the only options are ADD NEW and DELETE, so there is no way to connect to an existing database that is stored in a different pc.

I dont want to sync both pcs with a cloud servers because i dont want to store anything on my secondary pc, i only iwant to have the db on my primary computer.

Is there any way to connect to an existing hem2 database.

lozano

morny
08-01-2011, 10:03 AM
Ill check with the developers on this

jelozano
08-01-2011, 10:10 AM
Ill check with the developers on this

Ok, I think it must be easy to implement, in fact ive been looking if any of the config files contains the information of the "current databases" to change it manually, but I havent found it.

Its not only a feature that concerns my case (a local network, the problem is that my secondary pc is a netbook that does not have too much empty space, so i dont want to create a big database there), but can be a problem, for example, if i make manually a dump of the full database using postgresql command line, and then restore it in a second pc.

Its imposible for hem2 in the second pc to "connect" to this database created using a restore (postgresql command) and that is phisically on localhost, and this is a problem imho.

lozano

morny
08-01-2011, 10:57 AM
Yeah already have a bug for it #1768 but i dont have an estimate of when it will be implemented yet

jelozano
08-01-2011, 12:32 PM
Yeah already have a bug for it #1768 but i dont have an estimate of when it will be implemented yet

ok, at least now i know it is scheduled... anywhere anytime...

As a temporary solution, can you confirm that the "current databases" list isnt stored in any configuration files to edit by myself as a workaround?

lozano

navi
08-01-2011, 08:37 PM
ok, at least now i know it is scheduled... anywhere anytime...

As a temporary solution, can you confirm that the "current databases" list isnt stored in any configuration files to edit by myself as a workaround?

lozano

Have you tried clicking "Add New" on the #2 PC and entering the IP address of #1 PC as the database server? The only issue I can see with this is where the Database parent folder on the #2 PC should be stored i.e. should it point to the same folder on the #1 PC?

I would be interested to see if this works for you and to get some confirmation from the developers on whether this should work.

jelozano
08-02-2011, 01:41 AM
Have you tried clicking "Add New" on the #2 PC and entering the IP address of #1 PC as the database server? The only issue I can see with this is where the Database parent folder on the #2 PC should be stored i.e. should it point to the same folder on the #1 PC?

I would be interested to see if this works for you and to get some confirmation from the developers on whether this should work.

Yes, I've tried. I use the button "Test connection" using #1pc local IP, with my username/password (not default) and get a success message. In theory I can create a new database on #1pc this way (always from my #2pc), but obviously if I specify the name of the database I want to use it says something like "database already exists".

Also the "database parent folder" is something not valid, of course, when connecting to a remote database in another system, of course, I dont know exactly how to deal with that field in the form...

In summary, a new buton is needed "Connect to an existing database" ---- to check the connection, to list the hem2 databases in the postgresql server, and to connect to one of those.

lozano

navi
08-02-2011, 07:36 AM
Yes, I've tried. I use the button "Test connection" using #1pc local IP, with my username/password (not default) and get a success message. In theory I can create a new database on #1pc this way (always from my #2pc), but obviously if I specify the name of the database I want to use it says something like "database already exists".

Also the "database parent folder" is something not valid, of course, when connecting to a remote database in another system, of course, I dont know exactly how to deal with that field in the form...

In summary, a new buton is needed "Connect to an existing database" ---- to check the connection, to list the hem2 databases in the postgresql server, and to connect to one of those.

lozano

Hopefully this issue will be fixed. It would stop me from upgrading to HM2 if I could not use it over my home network.

netsrak
08-02-2011, 08:30 AM
There is a manual way to solve this - you can copy the parent database folder from PC1 to PC2.
When you now start HM2 you should have the option to connect to the existing database.
I hope i remember this right, i went through it some weeks ago when i created the bug report for this missing functionality.

jelozano
08-02-2011, 10:04 AM
There is a manual way to solve this - you can copy the parent database folder from PC1 to PC2.
When you now start HM2 you should have the option to connect to the existing database.
I hope i remember this right, i went through it some weeks ago when i created the bug report for this missing functionality.

The problem is that I dont want to store the database on #2pc, because the hard disk has not enough empty space.

Where is the information of current databases stored? Does it take by default all hem2 databases on localhost or takes the configuration of some config file or the registry.

I think a temporary solution would be:

In #1pc configure as if it were local network (using IP 192.168.0.50 instead of 127.0.0.1 or localhost), import all handhistory, and then export the configfile or registry or whatever to #2pc.

lozano

jelozano
08-02-2011, 04:58 PM
There is a manual way to solve this - you can copy the parent database folder from PC1 to PC2.
When you now start HM2 you should have the option to connect to the existing database.
I hope i remember this right, i went through it some weeks ago when i created the bug report for this missing functionality.

I've tried this (copying the parent "database" folder from pc1 to pc2).

HEM2 does not recognize it, only the one I created with pc2.
I have created a db with the same #pc1 name "xxxx" in #pc2, a folder has been created as usual, and then I have overwriting the folder from #pc2 with the folder from #pc1.

It recognise the database but for HEM2, the db is empty, no hands inside.

lozano

netsrak
08-03-2011, 04:19 AM
And did you connect to the already existing HM2 database on the postgresql server?

jelozano
08-03-2011, 10:20 AM
And did you connect to the already existing HM2 database on the postgresql server?

Nope...

corp

netsrak
08-03-2011, 01:53 PM
You need to do that - the postgresql database and the parent folder belong together.

jelozano
08-04-2011, 01:48 AM
You need to do that - the postgresql database and the parent folder belong together.

Yes, I did read a post of morny explaining that just after posting here it didnt work.

But It the meantime I tried to sync the database with the server, and then the activation on my #pc2 crashed by no reason, or at least it crashed because of me changing/moving/deleting folders (error: "Detected tampering or unauthorized removal of secure storage") and I have not been able to test anything more.

I emailed yesterday hm2support with this activation issue, but Ive got no reply yet...

lozano

jelozano
08-06-2011, 09:28 AM
You need to do that - the postgresql database and the parent folder belong together.

Ive tried but Its not clear to me how can i connect on #pc2 to the db.

So far Ive copied the dabatase folder (in the roaming/holdemmanager folder) from #pc1 to #pc2, how do i proceed now?

lozano

udbrky
08-06-2011, 01:40 PM
What email address did the crash report come from?

I'll leave the rest of the response to netsrak, as he's tried to accomplish this, I have not.

udbrky
08-06-2011, 01:41 PM
One idea though

Have you mapped the database parent folder from computer 1 as a network drive on computer 2?

jelozano
08-06-2011, 02:20 PM
One idea though

Have you mapped the database parent folder from computer 1 as a network drive on computer 2?

Interesting idea... Once i know how to connect to a existing folder (will wait to netsrak response) i will try to connect to the #pc1 mapped drive from #pc2.

It could be a solution meanwhile the feature "connect to an existing db" is implemented in hem2...

Another trick ive tried: stop the localhost server, start hem2, youll be advised the server is down and will be promted to connect to a db. Then you can use a remote server and suposely select a db, but the list of dbs of the remote server looks empty, do not why. If i use localhost instead, all local dbs shows up...

lozano

Sarek
08-07-2011, 05:00 AM
Again: this is because of DBparent not exists.
Btw, open DB in PGadmin and find there a table named "Settings" - you will see DBparetnt location.

jelozano
08-08-2011, 12:18 PM
Again: this is because of DBparent not exists.
Btw, open DB in PGadmin and find there a table named "Settings" - you will see DBparetnt location.

There were no database to modify the table settings. I simply copied from pc1 to pc2 the folder where the db was stored.

In pc2 there are no databases in the local server, so I cant search for the table settings to change the dabasaseparent row.

lozano

jelozano
08-27-2011, 09:25 AM
Any updates on bug #1768?

lozano

udbrky
08-28-2011, 03:53 PM
I do not have an ETA

jelozano
11-09-2011, 05:24 PM
Any updates on bug #1768?

Still no ETA?

udbrky
11-10-2011, 05:38 PM
I just sent nestrak a message for help on this.

netsrak
11-11-2011, 04:38 AM
There is no news for this. At the moment the only way to use a network database is to connect to the network database server and create a new database. The path for the files saved on the local file system (parent database folder) can be editied so you can choose a network folder to save space.
I don't have any ETA when other network functionalities will be implemented.

jelozano
11-11-2011, 02:55 PM
There is no news for this. At the moment the only way to use a network database is to connect to the network database server and create a new database. The path for the files saved on the local file system (parent database folder) can be editied so you can choose a network folder to save space.
I don't have any ETA when other network functionalities will be implemented.

Ok, In this case I will wait to upgrade my license and I will continue using HEM1 until then.

Jose Lozano

Rick200SX
11-23-2011, 07:51 PM
I think i have the same problem. I have succesfully connected my PC to my pgsql database on my server. The PC copied old data from the HM1 database to the new HM2 database. Now i can use HM2 on my PC.

At the moment im on my laptop installing HM2. Everything works out fine, but now i have to connect to my database. That works, but then it wants to create a new database. I don't want to create a new database, i just want to connect to my existing database... There is now way i can do that :S

Any word on that?

Sarek
11-24-2011, 08:13 PM
Currently if you want to keep HM2 database on server - you have to create DBparent on the same machine (server).
Or move it there.
As it was told earlier, for existing DB you can change DBparent location directly inside DB - in table "setings".

jelozano
11-29-2011, 01:25 PM
Currently if you want to keep HM2 database on server - you have to create DBparent on the same machine (server).
Or move it there.
As it was told earlier, for existing DB you can change DBparent location directly inside DB - in table "setings".

I do not know how dbs are stored in postgresql or hem, is there any step-by-step guide in the faq section where it is explained in detail the process to access a database through a network?

Sarek
11-29-2011, 02:31 PM
Keeping database on server is above "ordinary HM users" do.
http://hm2faq.holdemmanager.com/questions/1032/Run+PostgreSQL+Over+a+Network+
Currently that is all we have in FAQ

jelozano
11-29-2011, 02:42 PM
Keeping database on server is above "ordinary HM users" do.
http://hm2faq.holdemmanager.com/questions/1032/Run+PostgreSQL+Over+a+Network+
Currently that is all we have in FAQ

That's exactly how I've configured HoldemManager 1 to access my main db over my home network, and it is a pretty easy process, dont know if it is beyond "ordinary HM users" capabilities...

But now on HEM2 all is different, and I have to deal with parentDBs and probably i have to share some directories (not sure), and i am a little lost, since I dont know how postgresql stores data.

Sarek
11-29-2011, 02:56 PM
Yes, you have to share network folders and do some other things.
Can you tale a look here - there is a kind of instruction (http://forums.holdemmanager.com/general-support/151811-dump-db-uninstall-pg-reinstal-pg-restore-db.html#post775031), but for the same PC. Adapt it

jelozano
11-29-2011, 03:02 PM
Yes, you have to share network folders and do some other things.
Can you tale a look here - there is a kind of instruction (http://forums.holdemmanager.com/general-support/151811-dump-db-uninstall-pg-reinstal-pg-restore-db.html#post775031), but for the same PC. Adapt it

I will check it, thanks.

Rick200SX
12-11-2011, 12:03 AM
You don't have to share nothing! I'm using Holdem Manager 2 right now, and it is storing the data on my server pretty nice! It doesn't need file sharing. It's just an PostgreSQL server running on my Linux server.

The only thing i want to do now, is let the HM2 on my laptop connect to the same server. That shouldn't be this difficult. I tried to look in the windows registry for the database settings. I found them, but i couldn't find where it stores the database name. I even tried to copy the whole HM2 install i have on my pc to my laptop. I was hoping it would skip the welcome screen and recognize the database that way, but no luck.

You guys really don't have to make it this difficult, since it really isn't. I just want to point HM2 to my server, and that's it. But i can't and it's kinda frustrating that such an easy thing can't be done manually.

Now i have to be scared even like: I sure hope my pc doesn't crash because if it does, i can't connect to my database anymore! Sure i have the stuff securely on my server, but HM2 won't let me connect to it...

Can you guys please fix this in the next update? I really enjoy your great products, but in HM1 it was so easy, and now you guys are talking about it as if it's rocket science. Well It ain't... Just skip the welcome screen, or put some button to connect to an existing db in it. I can connect to my DB just fine, it only needs to connect like my pc does now :)

netsrak
12-11-2011, 05:56 AM
Unfortunately the database connection is not that easy in HM2. You need the database parent folder to connect to an existing database. The only way to connect from 2 computers to the same database is having this folder on a network share.

If you can't get a postgresql connection from your Laptop:
1. can you "ping" your network server?
2. can you connect via pgadmin to the network server?
3. if this works try "Test connection" in HM2. After this is successful you can create a new database.

Rick200SX
12-11-2011, 11:48 AM
Yeah like i said, everything works fine, except for that i can't let HM2 use the database that's already there.

You don't have to share anything. That shouldn't be necessary. HM2 is using PGSQL on my server perfectly! It doesn't need a share. Couldn't you guys insert some expert features to let us choose our own database location? This will safe allot of time. Getting a database back like i see people write about is plain stupid and shouldn't be that difficult to start with, Hence a database only stores data and should be easy to connect to or recover data from.

Everything works fine right now on my laptop, the only thing is that HM2 is refusing me to connect to my existing DB, it just want's to create a new db. Ooooh boy if i could only use my DB, all problems would be solved :D

If you guys can't help me them i'm continuing my own search. This can be done, i know it for sure :) If succeed i will let u know!

Rick200SX
12-11-2011, 12:59 PM
Yeah Boiiiii! Aight guys i got it working! My laptop now connects to the same database on the server... I just saw my cash results just like they show op on my main computer. MBN! :)

Now im gonna play some tables on my PC and see what happens on my laptop...

--Edit:

Hmm i see... The database connects fine now, and i can use HM2. But it seems that HM2 doesn't store the results in the database anymore. It just stores everything on the harddrive... Why is that?

So that means when you backup your DB, if you don't have the files stored on your harddrive (in a hidden folder called roaming) your DB backup is pretty useless...

Not to worry guys, if this is true, you INDEED need a network share. But im getting the hang of this, so im working on another solution WITH the networkshare. Let's just hope that the people overhere are working on somekind of update to eliminate the storage on your local harddrive because that makes no sense if the program has a database to store it's data.

--Edit 2: Got it working now with a network share. This really shouldn't be necessary... Can someone tell me why HM2 is storing data that should be stored in the database on the local harddrive?

Patvs
12-11-2011, 05:45 PM
In HM1 there are a lot of tables that deal with a specific hand played by a specific player. In HM2 we don't have these tables, instead, for player related hand data, we use a flat file approach. Each player has his own folder and each file represents a single day. Each line within the file is a tokenized version of a single hand with incredible amounts of detail.

Your overall HM2 spaced used (DB + Files) is almost half of HM1 and we store probably 2-3 times as much info plus it can be accessed many, many times faster and allows us to do some things that wouldn't be possible otherwise, many of which are yet to come.

So those files are stored locally to the Roaming folder on C:/
.

Rick200SX
12-11-2011, 07:06 PM
Yeah i appreciate that but i don't understand why this software needs both a SQL server and some local storage... Because i found out that the DB is useless without the files on your HDD... Can't these files be stored in some table? Should be possible... Just store the raw data in the SQL database... Just the data that's in the files, in a record in the DB.

Maybe something for the future? Shouldn't be a problem if u ask me.. And remember! Don't wanna sound cocky, just help...

BTW! I can confirm that my DB now works on my PC and on my Laptop. I had a running bad session just yet, got stacked meeh. Saw the line drop on my PC, and now im on my laptop, and i see the same drop... So: Works nice! The files that are needed by HM2 now are stored on my server aswell...

Patvs
12-11-2011, 08:40 PM
If the hands are added in the SQL database, every hand would need a table with for example: [date] when the hand was played, [hero], etc.
Storing the hands in thousands of folders (every folder = different date and player) it saves a lot of diskspace.

It's definitely not a "pretty" structure: small database = 100.000+ folders in C:/... Roaming. But 1 million hands now only takes up 5 GB of diskspace, vs it would take up 15+ GB with a similar HM1 database structure.

Not Excessive
12-11-2011, 10:14 PM
With the price of disk drives these days, the amount of space occupied by a db should not be a major factor. Being able to network the db, or providing a simple backup/restore function for that networked db is, imo, a major factor. I also feel that spreading the db 'load' across a local drive and networked drive not only doubles the risk of something going wrong, but also doubles the risk of not being able to recover from such a misfortune.

I think the developers have chosen the wrong path.

Patvs
12-12-2011, 09:13 AM
HM2's app "HM Sync" solves this issue (the difficulty that came to setup a shared networked database for the average user).
Also disk space is an issue, since most users with a large database are considering (or have already bought) a SSD drive.

Windows + 5 million hand database on the SSD + enough free space to vacuum/analyse/reindex the database:
-HM1 (30 + 50 + 50) = 130 GB
-HM2 (30 + 25 + 25) = 80 GB
(HM2 using HM1's structure 30 + 75 + 75 = 180 GB)

100 GB SSD difference already is $200 you save in needing a smaller SSD.

Rick200SX
12-12-2011, 10:24 AM
I have a 240GB Revodrive 3 x2 (hidden brag) in my pc and for things like data i have a 3tb ordinary disk.

Anyway: It's nice to see that you people made a new structure that saves allot of space. This indeed fixes some performance stuff. I mean how bigger the DB, the slower HEM will be. That's true. The only thing i personally find weird is that it now needs local storage and a DB. In my opinion you could save all the playernames to some table, instead of using directories for it. Then use the id that the player got by putting it in a table to save space ;) I figured out that HM1 saved allot of duplicate names for people and stuff like that. By putting players in 1 table and using the id's to search for different data of that player, saves ALLOT.

I'm working with db's daily as i'm a developer.

But ah well, i got my pc and laptop working for now. Indeed, to configure anything like my setup u do have to know what you're doing :) My DB is now running on my linux server with 4TB in RAID0 so should be fine :P The data is also stored on my server now.

Good to know for people: If can't only backup your PGSQL server anymore as it is uselss without the local storage! Just backup data from HM itself and not via some database tool. Best thing after the backup is to verify that u have all data and that it's not corrupt in some way!

jelozano
12-14-2011, 04:10 PM
Rick, do you mind to explain how did you succeed on using your database over a network?

Sarek
12-14-2011, 05:47 PM
1) Internal HM backup preserves both DB and Parent
2) Please tell in details how you did all this - it will be helpfull for many people.

Rick200SX
12-15-2011, 05:46 AM
It will take me some time to write a decent how to with screenshots or what ever. I'm willing to make one if i have the time for it, so please be patient :)

jelozano
12-15-2011, 04:35 PM
It will take me some time to write a decent how to with screenshots or what ever. I'm willing to make one if i have the time for it, so please be patient :)

No problem, if you make a step-by-step guide it will be worth the time waiting so take your time.

jelozano
01-02-2012, 07:46 PM
Still no news from the guide?

Rick200SX
01-03-2012, 12:44 PM
Still haven't found the time yet, very busy with work at the moment... I will create some time soon, so you guys can enjoy storing data on your servers again :) Here it still works flawlessly.

jelozano
02-14-2012, 02:42 AM
Well, two months since the first offering to write a guide to setup HEM2 through a network and still no news.

At this point I dont think it is a matter of time.

DogNamedBluff
02-14-2012, 03:40 PM
Is this what you are looking for? Run PostgreSQL Over a Network (http://hm2faq.holdemmanager.com/questions/1032/Run+PostgreSQL+Over+a+Network+)

jelozano
02-15-2012, 02:29 AM
Is this what you are looking for? Run PostgreSQL Over a Network (http://hm2faq.holdemmanager.com/questions/1032/Run+PostgreSQL+Over+a+Network+)

That guide is only for HEM1, not HEM2...

DogNamedBluff
02-18-2012, 07:49 AM
I apologize. I gave the wrong information. Here is the correct FAQ in regards to this situation: How can a database be accessed by two or more computers with HM2? (http://hm2faq.holdemmanager.com/questions/1791/How+can+a+database+be+accessed+by+two+or+more+comp uters+with+Holdem+Manager%3F)

jelozano
02-18-2012, 08:17 AM
I apologize. I gave the wrong information. Here is the correct FAQ in regards to this situation: How can a database be accessed by two or more computers with HM2? (http://hm2faq.holdemmanager.com/questions/1791/How+can+a+database+be+accessed+by+two+or+more+comp uters+with+Holdem+Manager%3F)


No problem.

Btw, that guide looks exactly what i was looking for. Thank you.

jelozano
02-19-2012, 07:01 AM
Well, looks like it worked (i'm testing it importing my whole db, it will take ages to end).

The only problem i faced is that even in the "server pc" you have to setup the dbparent folder as if it were a network shared directory.

For instance, in the server pc (the pc that will store the database) if you share a directory c:\hem2shares you have to map it to something like to x:\ using "connect to" feature, so in each pc that wants to use the same database the dbparentfolder must be exactly the same.

Besides that, its working properly.

Thanks again

Rick200SX
02-23-2012, 08:27 PM
Hi guys,

I'm still working with my DB on the PC and on my Laptop, all being stored nicely on the server. Even the configurations i do on my PC, run on my laptop aswell.

I have to say, writing a proper how-to with screenshots and stuff like that will take me some hours or maybe days of work. I mean, i need to write it so that all of you guys know what to do (and i have to make screenshots to make stuff clear) because some stuff you have to do is leaning to expert computer work. I also have to test it again, to see if my guide is working correctly. Dunno if that is +EV? :P