INTERACT FORUM

Please login or register.

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

Author Topic: Sync Library on different PCs  (Read 3341 times)

mdav

  • Junior Woodchuck
  • **
  • Posts: 60
Sync Library on different PCs
« on: November 02, 2012, 12:36:30 pm »

This has been discussed before, but I have a slightly different setup.

Setup:
PC1 - main PC (not on 24/7) with MC18 installed used for tagging media
PC2 - HTPC (not on 24/7) with MC18 installed used for playing media
Server - WHS 2011 server (on 24/7) used for storing and sharing media files, MC18 not installed (at the moment)

Goal: To sync library on PC1 with PC2 (HTPC) without PC1 and PC2 to be powered on 24/7.

Alt 1): Use Library server on PC1 and then sync on PC2. This isn't optimal as PC1 isn't powered 24/7.

Alt 2): Use Clone libray to a folder on the Server. Then add library on PC2 when you are using PC2. Clone library has however a disadvantage of requiring an empty folder all the time so the path has to be changed.

Alt 3): Use another backup program on PC1. With one click (or scheduled) you are able to copy the library to the server. Then with one click you copy the library to the library folder on PC2.

Alt 4): Install MC18 on the server and let Media Server (with Library server) run 24/7. Then sync on PC1 and PC2. As I want to tag on PC1 I have to use Library Server Sync.

I want the experience on PC2 (HTPC) to be snappy (take advantage of the installed SSD) so I think it's better to have the library locally, i.e. using alt. 2) or 3) (preferably 3). Am I wrong here? May alt. 4) be the option to go for? Thoughts?

Maybe the possibilities with Library server has to be improved.
         
Logged

BartMan01

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1513
Re: Sync Library on different PCs
« Reply #1 on: November 02, 2012, 08:15:14 pm »

Logged

mdav

  • Junior Woodchuck
  • **
  • Posts: 60
Re: Sync Library on different PCs
« Reply #2 on: November 03, 2012, 03:44:44 am »

Fortunately, I haven't used the default shared Music folder at all. Maybe I should disable the Media Streaming Metadata Synchronizer in WHS 2011 anyway.
Logged

MrHaugen

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 3774
Re: Sync Library on different PCs
« Reply #3 on: November 04, 2012, 09:39:42 am »

Alternative 4 will be the less troublesome of the options in my opinion. I think the clients will cache all important data on the local SSD, so it should be very snappy. I've not noticed any annoying latency's on my clients.

Only problem with library server today is that not everything can be edited from the clients. The general rule of thumb is that when "physical" changes on the media is required, you'll have to log on to the server and change things there. I simply use my workstation to connect to the server with RDP. It works reasonably well. Even though I would be glad to edit everything on the client some day. Normal things that needs a server connection is renaming of files and adding or editing cover art and similar images for media.
Logged
- I may not always believe what I'm saying

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sync Library on different PCs
« Reply #4 on: November 04, 2012, 11:08:38 am »

Alternative 4 will be the less troublesome of the options in my opinion. I think the clients will cache all important data on the local SSD, so it should be very snappy. I've not noticed any annoying latency's on my clients.on is renaming of files and adding or editing cover art and similar images for media.

This is correct.

You're overthinking it a bit, mdav.  When MC connects to a remote Library Server, it caches the entire remote library to: C:\users\<USERNAME>\AppData\J River\Media Center 18\Connected Library\

From then on, all "use" is made from this cached copy, not from the network connection directly.  MC periodically merges the cached copy with the Library Server copy in the background, so that you get new changes (and commit your changes from that Client).

So, unless your fast SSD isn't the one that contains your AppData directory (which wouldn't make any sense whatsoever), you'll get this benefit automatically.  When you initially open MC on the clients, it has to download the Library, which makes MC launch slightly slower, but that's the only "speed related" change you should see from running locally.  Once it is open, it will "feel" local.  And, on a LAN, that initial connection to the Library Server process is extremely quick (especially when you're using a SSD on the client).  I only see the "Connecting To" dialog box on my HTPC for a split second before MC opens.

Option #4 above is absolutely the best choice if you don't want to keep PC#1 on 24/7.  The main things you'll need to consider/realize are the limits of what you can do from a Client copy of MC.  I don't think they'll be too tough to work around, but you should be aware of them:

File Locations:

All media should be imported into your Library on the WHS box using a drive letter or UNC path that "matches" on all the clients.  Video playback, for one, will work much faster and more reliably if the client copies of MC can "find" the actual media files on disk over the network.  Otherwise, MC uses its built-in streaming functionality.  That's great for sharing files out over the Internet when you don't have a direct connection to the server PC's storage, but if you are on a LAN, there's no reason to do that because you can mount network shares and MC won't have to transcode and do all that work.  This will also allow all of MC's "file management" tools to work (like drag and drop, Locate On Disk (External), and other similar things.

There are two ways to accomplish this:

A. Put all media on the WHS box on a volume with a drive letter, and then share this entire volume out in Windows.  Then mount this share on your other PCs using this exact same drive letter.  So, if your drive is called M:\ on the WHS box, share the whole thing, and then go to each PC and mount a M: network drive pointing to that share.

B. If your media is on the WHS box in a variety of places, or on the C drive, option A will not be easy to implement.  Instead, make the shares on the WHS box as appropriate, and then import the media into the copy of MC running on WHS (the Library Server MC) using the UNC paths instead of drive letters directly.  So, for example, if your media is in C:\users\<USERNAME>\Music (and Video, etc), share each of these top level directories, and then import the media into MC using this path (these work in Auto-Import and everywhere else in MC):  \\servername\Music\, \\servername\Video\, etc.  If you've already imported your media using C:\etc\ type filenames, you can easily "move" them in MC using the Rename, Move, and Copy tool in Find & Replace mode.

Library Setup Limits:

While MC fully supports tagging and whatnot from the Client-side, there are certain functions in MC that can only be done directly from the Library Server itself.  This comes down, mostly, to this:  You can't change the Library structure at all.  Any changes made to things like Views, will be lost the next time you reconnect the Client.  This means that all Library Management tasks must be done directly on the server (or while connected directly to the Library, in any case).  This includes:

A. Adding or modifying Views in Standard View, including sorting, categories, columns, etc.
B. Adding or modifying Views in Theater View, including View Style (thumbnails vs. lineup vs list vs 3D style views, etc).
C. Adding or modifying Views in the Media Network setup of MC (DLNA, Gizmo, JRemote, and the entire REST API of MC).
D. Unless it was changed with MC18 recently (which is possible, I haven't checked), you can't delete Playlists from the client-side either.  You can modify existing ones (but watch out, it can get funky occasionally if you do things like restart the server without closing all the clients first), but you can't delete any of them.

So, while you can easily maintain your files from a Client copy of MC connected to a Library Server, you have to do modifications to the Library itself on the Server.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sync Library on different PCs
« Reply #5 on: November 04, 2012, 02:13:58 pm »

Working Around The Limitations:

So, now that I've explained what the limits are, here is a great way to work around the limitations.  One problem you might have with the proposed setup is if the WHS box doesn't really have a "desktop console" that you have easy access to (mouse, keyboard, etc).  All of the Library Management tasks I described above need to be done directly on the Library.  Luckily, however, they do not need to be done on the Server itself, only from a copy of MC (any copy) that is directly connected to the Library in read/write mode.

So, a solution is to set it up so that your Client copies of MC can also connect directly to the server's Library.  Then, when you need to do those Library Management types of tasks, you can do it from PC#1 physically, without having to rely on VNC/Remote Desktop to access the WHS copy of MC.

Here's how:

1. Make sure your Library is on a shared volume on the server.  The easiest way is to just put it with your media files, and that's how I do it.  So, using my examples above, if you have a M: drive, put the Library files in M:\Library_Data\ or something like that.  UNC paths will also work, though, so if needed you can just share out the location where the Library is stored on the WHS box.

2. On the clients, add a second Library (under Playing Now in the tree), and pick the shared location described above.  So, you'd add M:\Library_Data\ or \\servername\Library_Data\ as the path when you add the new Library.  So, you'll now have two "copies" of the same Library in your clients, one that works via the normal Library Server mechanism, and one that works "direct".  I like to label mine:

LibraryName (on Server)
LibraryName (Direct)

That makes it easy to tell them apart and remember which is which "mode".

3. Whenever you need to do Library Management, you can close down the WHS box's copy of MC, then open MC on the client and use the "Direct Mode" copy of the Library to make your changes.  This is a bit fiddly, but you can manage fairly easily.  Some tips:

* You can add a Library button to the top or bottom toolbars of MC.  This will present you with a list of your Libraries when clicked, and makes it easy to switch between different available Libraries in MC.

* You need to close down the copy of MC running on the WHS box before you connect to the Library directly on the client.  Otherwise, the client will connect to the Library, but it will do so in "read-only mode" (because only one copy of MC can have direct read-write access to a Library at any time).  You can close it down via Remote Desktop or VNC, if you'd like, but a better way would be to use a script and call it via PowerShell.  It'll be handy to have a second "Launch Media Server" script as well.

* A good workflow would be:
1. Close the client copy of MC where you're sitting (you don't have to switch Libraries or anything, just close it).
2. Close the Server copy of MC via your remote script.
3. Open the client copy of MC.  It'll fail to connect and prompt you to choose a Library to use, pick the Direct mode version of your Library.
4. Do what is needed.
5. Close the client copy of MC (or switch to a different, unrelated Library).  This is to free up the "read-only" status of the Library before you restart the Server copy of MC.
6. Re-Launch the Server copy of MC using your remote script.
7. Re-open the client copy of MC and reconnect to the normal "on Server" version of the Library.

Getting remote scripting to work can be fiddly if you aren't a good Windows Administrator, but you could accomplish the same thing almost as easily using VNC or Remote Desktop and just mousing and closing it.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sync Library on different PCs
« Reply #6 on: November 04, 2012, 02:16:08 pm »

Using PowerShell to Remote Control computers:
http://technet.microsoft.com/en-us/library/dd819505.aspx

I wouldn't bother going down the rat-hole of using PSExec (often recommended online) as it is fiddly and difficult to use on Windows Vista+ with typical settings, and requires you to really strip off some security on the machines to work reliably.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

mdav

  • Junior Woodchuck
  • **
  • Posts: 60
Re: Sync Library on different PCs
« Reply #7 on: November 14, 2012, 02:33:36 pm »

Thank you, glynor, for your detailed description of how it works! Good to know about the caching locally. That made me go for option #4. I have now installed MC on the WHS server. No problems with file location. All media media files are stored on D:\ (two separate HDDs in RAID 1) in \\Server\Shared\Music (Images, Videos). I have also add two libraries (on server and direct) as you suggested.
 
However, there are problems loading the library (on server) on the client. MC doesn't succeed in connecting to the library (on server) at startup, except on certain occasions. But when I start MC and try to load the library (direct), it succeeds most of the time connecting to the server. Then I could try to load the library (on server) again and then it works more often. Strange!

I have tried both with Media Center active on the WHS server and with only Media Server active. Same result, i.e. sometimes it works, but most of the times not. I have no idea why. Is it a problem with DNS? Sometimes when I try to open a webpage, Internet Explorer fails to load it, but when pressing reload it shows up.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sync Library on different PCs
« Reply #8 on: November 15, 2012, 01:42:54 pm »

Just to make sure I understand...

You're trying to launch MC automatically on boot on the HTPC (not the server) and it is failing to connect to the server.  But if you wait a little while, and then try to open MC later, it'll work.  Is that right?

If so, that is probably because your network interface hasn't finished initializing yet (it hasn't gotten its address and isn't yet "online") when MC tries to load.  The solution is to make MC wait for a bit after booting before launching it.

The Windows Task scheduler can do this.  You can set a delay of an arbitrary amount of time for any startup task defined in the Task Scheduler.  So, instead of using MC's checkbox in Options to launch on boot, load it using the Windows Task scheduler.  You can have it go directly to Theater View too, using the appropriate Command Line option: http://wiki.jriver.com/index.php/The_Command_Line

If that's not it, and it is sometimes connecting and sometimes not (even when both machines have been booted up for many minutes or hours), you might be hitting either:

1. A buggy network stack.  Try updating the drivers for your network interface.
2. Bad cabling or a flaky router.
3. Firewall issues.

MC's Media Server will work best if you manually open the appropriate port through the Windows Firewall on the Server system, to allow incoming connections.  You'll want to open the port for TCP for the port number listed in MC's Options > Media Network > Advanced > TCP Port (or disable the entire Firewall).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

greynolds

  • Citizen of the Universe
  • *****
  • Posts: 558
Re: Sync Library on different PCs
« Reply #9 on: November 15, 2012, 11:44:05 pm »

I just played around with this a bit using MC 17 as I haven't gotten around to installing 18 yet, but I would assume that my comments apply equally to 18.

Accessing the library located on SERVER from CLIENTPC works fine, BUT all files need to be in the library with UNC shares or MC won't find them.

For example, if my music is located in G:\Music located on SERVER, CLIENTPC won't know how to find the music files when it loads the library (because it either doesn't have a G: drive or the G: drive obviously isn't the same G: drive).

The solution is to setup the library so that music is located in \\SERVER\Music and make sure that CLIENTPC has appropriate network access to that share.  In my case, some of my files are already in the library on UNC paths, but some are on local drive paths.  Same thing for everything else in the library - make sure everything is using UNC paths so other PC's that open the library can find all the files.  So I've got a bit of configuration to do to make everything work smoothly, but this is a nice way to be able to work on tagging from a PC that's got a better keyboard / mouse / monitor setup for it.

Edit: It looks like Glynor covered this in the 5th post in this thread in the "File Locations" section of his post.  But it definitely bears extra emphasis in relation to his "Working Around The Limitations" post.
Logged

mdav

  • Junior Woodchuck
  • **
  • Posts: 60
Re: Sync Library on different PCs
« Reply #10 on: November 16, 2012, 02:57:17 pm »

Both yes or no. I don't launch MC automatically on boot on the client (PC1), but on the client (PC2 - HTPC). However, testing has been done on PC1, i.e. MC is launched manually after boot. The problems have occurred randomly so suspect some issues with networking on the server. The firewall on the server is already set to accept both incoming and outgoing traffic for MC (all ports).

I don't have an external router, but two NICs installed on the server. The hardware in the server is only half a year old with latest drivers according to WHS. I found some energy saving settings enabled by default on both NICs (allowed to be shut off to save energy) and I have now disabled that. I'll see if that helps.

I have also tried to activate WHS to act as a DHCP-server, but didn't succeed (no internet access on the clients) so I gave up on that leaving it as it was (NIC1, external, with IPv4-address and DNS-server automatic and NIC2, internal, a static IPv4-address, no std-gateway defined, no DNS-server defined).

All file locations has UNC paths to a shared location so no problem with opening the files, when the library is loaded.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sync Library on different PCs
« Reply #11 on: November 17, 2012, 08:42:26 am »

I don't have an external router, but two NICs installed on the server.

Well...

That's gutsy.

Is the server connected directly to the Internet?

Running with that kind of network configuration can be complex.  Your problem could be in network routing.  Do you have ICS enabled on the server in order to get the HTPC online?  Or are you running it with static IPs on the HTPC and the server's second NIC?  Maybe set up that way to specifically keep the HTPC offline?

EDIT:  I just read properly.  It looks like you're doing it with static IPs.  It might work right if you enable Internet Connection Sharing on the server, and move away from the Static IPs.  But doing it that way is just quite complex.  There's a whole swath of firewall and network routing issues you have to deal with.  ProTip:  You do have a router.  It is the server.  You just have to manually manage it, which is annoying.

Honestly, it would be MUCH easier to just buy a cheap NAT router (and probably a bit safer).  This coming week will probably be a good time to pick one up.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

mdav

  • Junior Woodchuck
  • **
  • Posts: 60
Re: Sync Library on different PCs
« Reply #12 on: November 18, 2012, 03:08:17 am »

Yes, ICS is enabled and running. Only static IP-address for the second NIC on the server and no other static IPs.

It seems like preventing the NICs going "to sleep" by disable the energy saving settings for them did the trick (fingers crossed). No problem for two days with connection to the library (on server).

Logged
Pages: [1]   Go Up