As follow up of my previous post on how to share your XBMC library on a Synology NAS with XBMC 11.0 (Eden) I made this guide based on XBMC 12.0 (Frodo). In this post I'll guide you to the process of moving your XBMC library from your HTPC (or Apple TV or RaspPi) to the Synology DiskStation. So why do you want this? Well a centralized library brings multiple advantages like being able to stop a movie or TV show on one device and continue watching it on another one. Also the watched-state of your media is distributed across your devices. This guide is based on the following software and hardware versions;
- Synology DS 3612xs with DSM 4.2 Beta (I run this DiskStation as a virtual machine; http://www.robvanhamersveld.nl/2013/01/21/install-and-test-synology-dsm-in-a-virtual-machine/)
- XBMC 12.0 Frodo
I'm using a Synology DiskStation but you can use virtually anything which is capable running a MySQL server instance, for more information about how to install MySQL on your platform visit there website: http://dev.mysql.com/
XBMC file locations
First take a look at where XBMC place the configuration files, later we need to edit some of them and place some additional files.
- Windows XP:
Documents and Settings\USERNAME\Application Data\XBMC\userdata\
- Windows Vista/7:
- Mac OS X:
From now on when I refer to 'XBMC userdata folder' I mean the one listed above.
Create a sources.xml file
One of the configuration files we need to edit is the sources.xml, in this file we will define where the media is located. If you want to use the shared library options later you must keep in mind this location must be accessible from all of these devices. I'm using the default smb video share of my Synology DS with access permissions for everyone so I'm not using any usernames and passwords on my file share. The sources.xml will look like this;
Click sources to download my sample file (rename the file extension to xml). Place the sources.xml file on all your XBMC installations in the XBMC userdata folder.
Enable MySQL and phpMyAdmin
Now we will make the preparations to use the MySQL database for you shared XBMC library.
First step is to enable MySQL on the DS (if you don't use a Synology DS check how you can install MySQL on your device at http://www.mysql.com/). Open the Synology Disk Station Manager (DSM) and open the 'Control Panel' and click 'Web Services'. Enable MySQL by placing a check at 'Enable MySQL' and click 'Apply';
Now we need to install the phpMyAdmin package so we can create and edit the databases (If you don't have a Synology DS please check the phpMyAdmin website to see how to install it on your device). Open the 'Package Center' and click the 'Utilities'-tab. Locate the phpMyAdmin package en click 'Install'.
Follow the instructions in DSM to complete the installation.
Configure MySQL for XBMC
In my previous guide we manual created the SQL databases for XBMC, with version 12.0 the databases will automatically created by XMBC. The only thing we need to do is create a user account Open phpMyAdmin from the menu (or browse to http://SYNOLOGYIP/phpMyAdmin), the default login is username root without a password.
Click on the 'Add user' link at the 'Users' tab.
Fill in the user details, I'm using username 'xbmc' with password 'xbmc'. Click at 'Global privileges' on 'Check All', by doing this the account is capable to create and alter databases on the MySQL server. In a production setup you probably don't want to do this but in a home network it's fine.
That's it, your database server is ready to serve XBMC.
Connect XBMC to your shared database
OK, the database is up, only thing left is to connect XBMC to it. There is no fancy configuration option in the GUI so we have to edit/create a .xml file again. Don't worry, it is't that hard
The file we need to create (not default present after the installation of XBMC) is advancedsettings.xml and place it into the XBMC userdata folder. In this file we define the MySQL database connection. It should look like this;
You must replace ***.***.***.*** with the ip-address of your MySQL database server. You can download a sample file here: advancedsettings (rename the file extension to .xml).
That's all, your centralized library and media files are ready to use.
In XBMC 11.0 (Eden) you had to move your thumbnails folder to a shared folder and redirect this folder from your client using pathsubsitution or symlinks (Windows). In XBMC 12.0 this isn't necessarily, XBMC now uses a local thumbnail cache. The thumbnail location in the database points to the on-line image, when the XBMC client access this file it's being cached locally to increase performance.