HowTo: Centralize Your XBMC Library with MySQL


Recommended Posts

If you want, you can have the thumbs local on all machines, but still in sync

 

I use dropbox (Granted it's all on windows machines) to sync the thumbs folder. Instead of using pathsubstitution, I used a symlink that points to the dropbox folder on each computer.

 

Not sure if you can install dropbox on openelec though, but it looks like some people have done it: http://openelec.tv/forum/65-storage/23455-solved-autostart-dropbox#23455

 

EDIT: I suggest you also look into adding skip-name-resolve to your mysql my.cnf if you haven't done it already. It didn't make a difference for me (my entry into library is already very quick) but some people claimed it worked for them

 

Seems to be issues with skp-name-resolve in the my.cnf if installed as I did with the unmenu package.  Referring to your  thread http://lime-technology.com/forum/index.php?topic=18417.msg167366#msg167366.  Will try doing the same on mine and see how it goes.

 

Link to comment
  • 1 month later...
  • Replies 195
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I implemented this myself this weekend and thought I would share my steps.

 

With XBMC Eden (I am using Openelec 2 beta 3), I did the following steps:

 

1. Install MySQL

  unRAID 5: http://lime-technology.com/forum/index.php?topic=20603.0

  unRAID 4: Install via unMenu

 

2. Follow this tut at OpenELEC to create xbmc-MySQL-user and grant all privileges (http://wiki.openelec.tv/index.php?title=Configure_MySQL_database - Adding indices is redundant for XBMC Eden, so don't follow this step)

 

3. If you want to share thumbnails and fanart, scrape your Movies/TV/Shows/Music locally and copy your thumbnails folder from your media center over to the server (I use my ssd cache drive for that scenario)

 

4. Now you have to add path-substitution, from now on thumbs and fanart will be fetched from the unRAID-server, plus you can also add your sources.xml

<advancedsettings>

    <videodatabase>

        <type>mysql</type>

        <host>xxx.xxx.xxx.xxx</host>

        <port>3306</port>

        <user>xbmc</user>

        <pass>xbmc</pass>

    </videodatabase>

<pathsubstitution>

<substitute>

<from>special://masterprofile/sources.xml</from>

<to>smb://xxx.xxx.xxx.xxx/apps/xbmc/userdata/sources.xml</to>

</substitute>

<substitute>

<from>special://masterprofile/Thumbnails/Video/</from>

<to>smb://xxx.xxx.xxx.xxx/apps/xbmc/userdata/Thumbnails/Video/</to>

</substitute>

</pathsubstitution>

</advancedsettings>

 

5. Copy advancedsettings.xml to all your other XBMC clients.

 

 

The performance of this setup is excellent.

Link to comment
  • 4 weeks later...

Thanks p1lot for the walk through. I had issues having openelec use the mySQL database. XBMC/openelec can now access the mySQL database after removing "<name>xbmc_video</name>" and "<name>xbmc_music</name>" from the advancedsettings.xml. I can't believe I missed that from comparing different tutorials. After restarting openelec,  MyMusic18 and MyVideos60 was created automatically in mySQL :)

Link to comment
  • 1 month later...

well i was thinking of also adding a ssd to speed up my thumbs and mysql but the nasty thing was ....

 

I added an Apple tv 2 in my bedroom .. jailbroke it and installed xbmc on it

and guess what ... this little stupid box was like 10 times faster then my full blown htpc computer / my i7 desktop and my kids desktop.....(all running w7 x64 ultimate)

 

so the issue had to be somewhere else ... so i changed my antivirus settings to allow all traffic from my unraid server.... without real time scanning ...

 

and yep the thumbs are nearly as fast now as the apple tv...

the mysql is still a tat slower from windows though ....

i have already

skip-name-resolve

in my.cnf

and already changed settings for a pretty big cache...

so there is still a windows setting that is making this slower then whatever freebsd version apple is using :P

 

 

any of you linux geniuses know if there is something else i can tweak ?

 

Link to comment
  • 2 months later...
  • 2 weeks later...

After applied all those steps, my xbmc on my mac becomes extremely slow. I can barely move cursor on the screen. Any idea why? This is my first time setup xbmc. I haven't even assign movie folders yet. 

 

It seems without the advanced settings file, XBMC works fine locally.

 

More than likely an issue with the MySQL database. I can't tell you which one, but that's the problem I get when I make a mistake with MySQL (suuuuuuuuper slow XBMC instances).

 

What does your advancedsettings.xml look like? Also, in MySQL on your unRAID box, add this when in MySQL (without quotes): "GRANT ALL ON *.* TO 'xbmc';" and press return

Link to comment

My advancedsettings.xml also contains the following to redirect the folders to the NAS share. Not every plugin uses it but I opted to ignore the local caching of thumbnails for them.

 

  <pathsubstitution>
    <substitute>
      <from>special://profile/Thumbnails/Video/</from>
      <to>smb://NAS/xbmc/Thumbnails/Video/</to>
    </substitute>
    <substitute>
      <from>special://profile/Thumbnails/Music/</from>
      <to>smb://NAS/xbmc/Thumbnails/Music/</to>
    </substitute>
    <substitute>
      <from>special://profile/playlists/</from>
      <to>smb://NAS/xbmc/Playlists</to>
    </substitute>
    <substitute>
      <from>special://profile/addon_data/</from>
      <to>smb://NAS/xbmc/AddonData/</to>
    </substitute>
    <substitute>
      <from>special://profile/sources.xml</from>
      <to>smb://NAS/xbmc/Sources/</to>
    </substitute>
    <substitute>
      <from>special://profile/mediasources.xml</from>
      <to>smb://NAS/xbmc/MediaSources/</to>
    </substitute>
  </pathsubstitution>

Link to comment
  • 3 weeks later...

Anyone had a look at this thread: http://forum.xbmc.org/showthread.php?tid=132919

 

It's purpose is to build a headless XBMC install to run on your media server and update the local MYSQL db so you do not have to have a separate XBMC box updating the MYSQL db. Which I would assume most people in this thread would be interested in.

 

The thread is a little all over the place/hard to follow. But apparently the build instructions are here: http://forum.xbmc.org/showthread.php?tid=132919&pid=1182615#pid1182615

 

I have no idea how or what to do with that info and have no idea if this would even run on an unRAID build. But if someone smarter then me who is also interested wanted to take and look and report back..... It looks like it would fill in the final gap in having a complete server backend for XBMC. FYI, it does require Frodo, tho there looks to be an Eden patched version....

Link to comment

Anyone had a look at this thread: http://forum.xbmc.org/showthread.php?tid=132919

 

It's purpose is to build a headless XBMC install to run on your media server and update the local MYSQL db so you do not have to have a separate XBMC box updating the MYSQL db. Which I would assume most people in this thread would be interested in.

 

The thread is a little all over the place/hard to follow. But apparently the build instructions are here: http://forum.xbmc.org/showthread.php?tid=132919&pid=1182615#pid1182615

 

I have no idea how or what to do with that info and have no idea if this would even run on an unRAID build. But if someone smarter then me who is also interested wanted to take and look and report back..... It looks like it would fill in the final gap in having a complete server backend for XBMC. FYI, it does require Frodo, tho there looks to be an Eden patched version....

 

Thanks for the heads up. After seeing your post I decided to give this a try and got this working after some fiddling. So I decided to report back.

 

I basically installed a fresh minimal ubuntu on my esxi box in a vm. Installed the various packages / libraries needed to build xbmc, checked out the xbmc code, compiled, made a start script and added a cron job to get this all working. I wouldn't say it was the easiest thing to do - all the information is indeed in the post, just scattered around.

 

A couple of caveats; it's using alpha frodo code so you must ensure that both the server and your clients are using the same db version (MyVideos69, 70, ..). In my case I'm running MyVideos68 on my clients which is a little old, I believe they're at 72 now. And secondly someone in the thread discusses this, the http api has been deprecated in favor of jsonrpc, which means that sickbeard and various other servers may have not be updated to make db updates via jsonrpc. Both of these reasons meant that I had to checkout older code (from Sept) and compile from that point. It was a bit of a trial & error process.

 

Anyway, if anyone has questions and would like me to post a guide let me know.

Link to comment

One heads up, there's a thread in the XBMC forums that mentions this feature as going away eventually and to be replaced with something else, possibly UPNP? Not clear to me and it's in another branch so I can't test it yet - I compile nightly on Linux.

 

Oh, ESX is virtualization software. Google can tell you volumes about it...

Link to comment

One heads up, there's a thread in the XBMC forums that mentions this feature as going away eventually and to be replaced with something else, possibly UPNP? Not clear to me and it's in another branch so I can't test it yet - I compile nightly on Linux.

 

Oh, ESX is virtualization software. Google can tell you volumes about it...

 

Yes, in frodo youwill be able to use upnp server on your xbmc machine, if your server is another machine than your xbmc machine and you want to use the upnp thing,your xbmc machine will have to be on too, next to your unraid machine and your second xbmc machine.

 

So in my opinion , upnp server on xbmc is worthless..

Im not going to turn on a third machine just so the library is shared..

Only thing left is mysql on unraid... That way i wont have to turn on 3 machines, but 2 will do.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.