Author Topic: sync database and stats  (Read 229 times)

capztan

  • Newbie
  • *
  • Posts: 5
    • View Profile
sync database and stats
« on: June 13, 2018, 12:51:57 PM »
Hey Corey  :)

Me and a friend want to host 2 different tourneys at the same time, will we be able to sync the database and stats from 2 different computers if we buy a second license?


Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5708
    • View Profile
Re: sync database and stats
« Reply #1 on: June 13, 2018, 01:10:27 PM »
Depends on what you mean by "sync".  If you simply want to be able to compute stats from both tournaments on one of the PCs, then definitely yes.

Assuming all players (from both tournaments) are in your player database, it's easy.  Just copy the tournament to your PC and run stats.

If your friend's tournament may have players not in your database, copy the tournament to your PC, load the tournament, then go to the Players tab and press the Database button.  Then press the "Add to database players in your current tournament" button.  Then you should be able to run stats and include everyone.

If you want to keep player details (phone number, email address, etc) in sync, that's a lot more difficult.  But the most important information on a player is their unique ID, which allows the TD to correlate players across tournaments.  And the unique ID is stored in the tournament file as well as the database.  So you can effectively "sync" players just using a saved tournament file.

capztan

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: sync database and stats
« Reply #2 on: June 13, 2018, 03:16:04 PM »
awesome, that sounds easy :)
i assume we have to buy a second license for his pc?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5708
    • View Profile
Re: sync database and stats
« Reply #3 on: June 13, 2018, 04:14:09 PM »
Sharing licenses is not allowed, so sounds like yes.

ddawson

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: sync database and stats
« Reply #4 on: June 27, 2019, 06:01:52 PM »
I have a similar question about synching two laptops that run TournamentDirector. Google Backup and Sync lets me sync folders between two computers.. I'd like to use that to keep two instances of TournamentDirector in sync. The idea is that whatever I put in a designated local folder gets uploaded to Google Drive, and when I open a second laptop, those changes are downloaded to the second laptop.

Currently I have set the Data Store location to that sync folder.

Unfortunately, even though the Data Stores dialog says that the data store contains the player database, saved tournaments, templates, images... it seems like when I add players on one laptop, save and close, wait for files to sync up to Google Drive, open the second laptop, wait for files to sync down, and open TournamentDirector, the players added on one laptop do not appear on the other.

Am I doing this right in theory? Is there anything else that needs to by synched between instances? I don't want to export/import the player database each time, though that does seem to work; it just has to be done manually each time.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5708
    • View Profile
Re: sync database and stats
« Reply #5 on: June 28, 2019, 12:20:19 PM »
That should be all you need to do.  The player database is stored in a single folder, "db", under the Data Store.  So if those files are synced, the same player database should appear on both PCs.

The only thing that comes to mind is that you could be using a different Data Store.  Most people don't.  Most people only use the default Data Store.  But the application does allow you to change the Data Store to a different location.  Is there any chance you've done that?  Perhaps you're syncing to the default Data Store but you're using a different Data Store.

ddawson

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: sync database and stats
« Reply #6 on: July 05, 2019, 05:57:51 PM »
Thanks Corey - in fact this does work with one additional step. After I add players on laptop #1 and close up for the night, on laptop #2 the only thing that I need to do is to reload the database. For this I created a hotkey (CTRL+R) = Reload Database. Players I create on one laptop appear on the other and life is good.

Follow up question: I can imagine that two instances if Tournament Director accessing the same data store *simultaneously* could lead to problems. For this reason I'm being careful to never run it on both laptops at the same time; there's no need, so not a problem. Can you confirm however, that indeed I should not be running two instances on a shared data store? Or do you think the underlying marshalling of config data will handle this?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5708
    • View Profile
Re: sync database and stats
« Reply #7 on: July 05, 2019, 07:34:18 PM »
You are correct.  The application isn't designed to have two instances run at once, and it comes with caveats, like changes to the player database in one instance won't be seen in the other until you exit and restart the application.  OR, as you have discovered, if you have it reload the database.  That feature was specifically added for this type of situation.  Even though it's not recommended, with some care you can make it work.  Just remember that if you make changes to the DB in once running instance and then make changes to the DB (the same DB) in another running instance, the second changes could *overwrite* the changes the first one made.  The application simply does not have any way to know that changes were made by another application (even another instance of itself).

So, yes, I can confirm you should not be running two instances on the same folder (or synced folder, since it amounts to the same thing).  But as I said, with some care you can make it work.  Just make sure that when you make changes to the DB in one instance that you reload the DB on the other instance.

ddawson

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: sync database and stats
« Reply #8 on: July 06, 2019, 02:31:39 PM »
Wonderful, thanks so much Corey!