INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Sharing database on multiple computers (again...)  (Read 6744 times)

lise

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 946
Sharing database on multiple computers (again...)
« on: March 09, 2006, 05:48:52 pm »

I think I read the relevant threads (see below for links), but it sure does seem complicated to share libraries.

Here is my new system to deal with this:

Computer A:  HTPC in living room. All files on M:\
Computer B: Machine used to tag, download, etc. Mapped to M:\ on computer A.

Whichever computer I am using, I finish doing my business and I backup the library to M:\.  When I go to the other computer, I restore the latest backup on M:\, do my business, and backup again. Etc.

Problem:
I can usually remember to do the backup when I'm ready to exit, but I consistently forget to restore the backup when I start on one of the computers, especially the HTPC which launches in Theater Mode (have to switch to standard, restore, etc).

Solution?
I know nothing about scripts, etc, but is it possible to write something that will automatically take the most recent backup and restore it whenever I launch Media Center?

And is there a similar thing I can do to first backup the library to the folder I choose (and replace an existing backup if there is already one for today) when I exit Media Center?

If the script business is possible, could someone point me to a "writing scripts for dummies" type page?

(I guess my system turns out to be as complicated as these, doesn't it? Although if these two operations were automated, I'd be in business!)

http://yabb.jriver.com/interact/index.php?topic=29585.msg204021#msg204021
http://yabb.jriver.com/interact/index.php?topic=26442.0
http://yabb.jriver.com/interact/index.php?topic=30190.0

Logged
A wise man once said don't count your years, but make your years count. Or was it beers?

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Sharing database on multiple computers (again...)
« Reply #1 on: March 13, 2006, 04:29:23 am »

After writing the post in the first link I have changed from restoring backups to copying the library data & thumbnail files because currently a library restore removes all old thumbnails.

Here is how I would do what you asked:

1) Make a simple and identical folder name for the media library on both PCs, like c:\lib\

2) Make a subfolder under c:\lib\ named tn (c:\lib\tn\).

3) Change this registry setting on both PCs:
HKEY_CURRENT_USER\Software\JRiver\Media Center 11\Properties\Thumbnails - Base Path
to c:\lib\tn\

4) Open MC and make a copy of the library to C:\lib with the library manager. Make this new library the active and default library. You can delete the old database and thumbnail files.

5) Copy the most recent c:\lib\ folder and all subfolders to M: (M:\lib\).

6) Make these bat files:

For closing MC and copying the database from C: to M:

CLOSE_MC.BAT
Code: [Select]
MC11.exe /Close
REM  press any key to start a library backup or Ctrl+C to abort
pause
xcopy C:\lib\. M:\lib\. /e /y


For copying the database from M: to C: and starting MC

START_MC.BAT
Code: [Select]
REM  press any key to start a library restore or Ctrl+C to abort
pause
xcopy M:\lib\. C:\lib\. /e /y
MC11.exe /Start


7) Put shortcut icons that run the bat files in convenient places, like on the taskbar.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

park

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2358
  • I wish I had more to say!
Re: Sharing database on multiple computers (again...)
« Reply #2 on: March 13, 2006, 06:21:59 am »

That's great Alex, thanks!

I use one library (on a portable drive) and have MC installed on 2 computers that access the same library. Now I can change the registry to tell my two copies of MC that there's a new common directory for my thumbnails file, on the portable drive, cant I. No more rebuilding thumbnails every time I get home/to work.  :)

Thanks.
Logged

raym

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3583
Re: Sharing database on multiple computers (again...)
« Reply #3 on: March 13, 2006, 06:23:21 am »


3) Change this registry setting on both PCs:
HKEY_CURRENT_USER\Software\JRiver\Media Center 11\Properties\Thumbnails - Base Path
to c:\lib\tn\

I'll thankyou for this tip too Alex!! I always wondered why my Thumbnails kept re-creating themselves!!  :D
Logged
RKM Smart Home - www.rkmsmarthome.com.au
Z-Wave Home Automation

park

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2358
  • I wish I had more to say!
Re: Sharing database on multiple computers (again...)
« Reply #4 on: March 13, 2006, 07:35:34 am »

I wonder, is there any way to get those bat files to run automatically when mc closes. perhaps using the media scheduler???
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Sharing database on multiple computers (again...)
« Reply #5 on: March 13, 2006, 07:37:58 am »

Alex, great setup! But I have what seem to me a simple question:

If the library is on a mapped drive, then why not just place a common library & thumb folder there?  If the library files were to be unavailable over the network then the music files are as well  (all or nothing).

I understand that this sets you up for a sharing violation, but could that not be used to advantage to 'lock out' a concurrent instance of MC on the other PC? (or is Windows unable to do this using share restrictions & security settings?)

I have noticed that the library and especially the thumbnails folder need fast drive access to work smoothly. The best place is a fast internal HD or if the drive is external it should be connected with Firewire or USB2. A network drive or shared folder has always a lot slower access time and data transfer speed even on a fast wired LAN.

A running standalone MC needs always database write access. Running two or more concurrent MCs safely is not possible when sharing a common database and thumbnail folder. At least the dynamically built thumbnails would get conflicting internal thumbnail references and possibly the other automatic changes (like the playcount and cache systems) would cause severe library corruption even the visible fields are not edited.

The system park mentioned is safe if he runs only one copy of MC at the same time.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Sharing database on multiple computers (again...)
« Reply #6 on: March 13, 2006, 07:43:50 am »

I wonder, is there any way to get those bat files to run automatically when mc closes. perhaps using the media scheduler???

It is easy to replace the MC start icons with icons that point to a bat file, but I don't know a way to make the exit buttons inside MC to run an external program after closing MC.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

paulr

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 527
  • nothing more to say...
Re: Sharing database on multiple computers (again...)
« Reply #7 on: March 17, 2006, 12:38:09 am »

Alex,

I use a script (VBS) to do something similar with POPFile and Outlook.  The script executes POPFile and waits for it to enter a running state.  It then runs Outlook and waits for Outlook to be closed.  Once Outlook is closed, it executes a POPFile shutdown routine.

Code: [Select]
Set objPOPFileStart = CreateObject("WScript.Shell")
Set objOutlookStart = CreateObject("WScript.Shell")
Set objPOPFileQuit = CreateObject("WScript.Shell")
objPOPFileStart.Run """D:\Program Files\POPFile\runpopfile.exe"" /startup",,True
objOutlookStart.Run """D:\Program Files\Microsoft Office\Office11\OUTLOOK.EXE""  /recycle",,True
objPOPFileQuit.run """D:\Program Files\POPFile\stop_pf.exe"" /showerrors 8081"

This works perfectly for my purposes, and I think it will work for you.  Change the variable names and the stuff in between the quotes to run your batch files and MC.  Then point the VBS file or shortcut to MC's icon and you're set.

I recently installed a Yellow Machine and I may just do this myself!



Logged

paulr

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 527
  • nothing more to say...
Re: Sharing database on multiple computers (again...)
« Reply #8 on: March 17, 2006, 11:38:31 pm »

Here it is modified for MC and using your batch files.  Just change the paths as required and assign the MC icon if you wish.

MC.vbs
Code: [Select]
Set objStartMCBat = CreateObject("WScript.Shell")
Set objRunMC = CreateObject("WScript.Shell")
Set objCloseMCBat = CreateObject("WScript.Shell")
objStartMCBat.Run "START_MC.BAT",,True
objRunMC.Run """E:\Program Files\J River\Media Center 11\Media Center.exe""",,True
objCloseMCBat.run "CLOSE_MC.BAT"
Logged

JONCAT

  • Guest
Re: Sharing database on multiple computers (again...)
« Reply #9 on: March 25, 2007, 11:06:54 am »

You need to check out robocopy...

"robocopy /mir  \\machine1\share1\dir1 \\machine2\share2\dir2

Will mirror one to the other and only sends updated files over the network... (WARNING: /mir and /purge will delete files on the dest. if they do not exist on the source. Use /s /e first to make sure your paths are correct!)

It is part of the 2003 RK and works great in XP..

http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en"

I was trying to get this to work with various syntax but I don't know this stuff well enough. I am searching the web for more info, but does anyone use this? I tried the mapped drive letter as well as the network location syntax. There are no spaces in the destination directory name, but I tired wrapping in quotes as well.

DC


Logged
Pages: [1]   Go Up