So first of all you should look at XBMC's official explanation as it's probably more presice than mine now:
http://wiki.xbmc.org/index.php?title=HOW-TO:Sync_multiple_libraries
I will short it down to the basics:
When you add a source in XBMC the library automatically stores itself on a local database called Sqlite on your local filesystem somewhere. Most people don't know about this and it will easily be lost when reinstalling.
To not lose your library information that has been recorded over a long time you really should use a database like MySQL to store it. More databases is probably supported and equally set up.
Library information is stuff like which episodes and movies have you seen, have you seen only half the movie etc. It also contains filepaths for each and every file. So all you need to watch your videos and listen to your music is stored here.
It will also suit for sharing the information if you have several xbmc installations (I will refer to them as clients from now on) and are switching between them.
You should add the MySql server software on a computer that's always turned on. The XBMC will not work if it can't reach the mysql db after this configuration. Probably you already have a file server that suits for this purpose as well.
Remember that the sources themselves will not be stored in mysql, I will come back to this in the end.
1. Install MySql
can be downloaded here. Make sure you set the setting that makes it reachable from outside of the server.
2. Create a user and grant full access to the two database
For Example:
CREATE USER 'xbmc' IDENTIFIED BY 'xbmcpassword';
GRANT ALL ON *.* TO 'xbmc'; --do this on both databases
XBMC will create the databases it needs.
3. Create advancedsettings.xml
containing this:
<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>***.***.***.***</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmcpassword</pass>
</videodatabase>
<musicdatabase>
<type>mysql</type>
<host>***.***.***.***</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmcpassword</pass>
</musicdatabase>
</advancedsettings>
5. Put advancedsettings.xml on the local home configuration area for xbmc
For Windows:
%APPDATA%\XBMC\userdata
For Linux:
~/.xbmc/userdata
Next time you open a XBMC client it will add all the tables and information by itself. No more configuration is needed.
6. Final point - Some concerns about the sources when using more clients
Sources concern 1:
The source paths you use must be available for any client in the same shape. Meaning you can't use a mapped network station on your windows client and then use the upnp streaming on the linux client. It just won't work because xbmc saves the full paths when a new file is discovered.
I use for example this path on all clients for the movies:
smb://SERVER/MEDIA/MOVIES
The EASY way to do this is to copy sources.xml and passwords.xml from the userdata folder referred to in 5.
Sources concern 2:
If you want all clients to be able to discover new files you MUST add the sources under Video or Music. And you must of course declare these sources the same way on all clients. For the same reasons as under sources concern 1. If you choose not to declare sources on one client, you will still be able to see all videos and music that is already added to the database. But you will then rely on another client to update the library when new files arrive.
http://wiki.xbmc.org/index.php?title=HOW-TO:Sync_multiple_libraries
I will short it down to the basics:
When you add a source in XBMC the library automatically stores itself on a local database called Sqlite on your local filesystem somewhere. Most people don't know about this and it will easily be lost when reinstalling.
To not lose your library information that has been recorded over a long time you really should use a database like MySQL to store it. More databases is probably supported and equally set up.
Library information is stuff like which episodes and movies have you seen, have you seen only half the movie etc. It also contains filepaths for each and every file. So all you need to watch your videos and listen to your music is stored here.
It will also suit for sharing the information if you have several xbmc installations (I will refer to them as clients from now on) and are switching between them.
You should add the MySql server software on a computer that's always turned on. The XBMC will not work if it can't reach the mysql db after this configuration. Probably you already have a file server that suits for this purpose as well.
Remember that the sources themselves will not be stored in mysql, I will come back to this in the end.
1. Install MySql
can be downloaded here. Make sure you set the setting that makes it reachable from outside of the server.
2. Create a user and grant full access to the two database
For Example:
CREATE USER 'xbmc' IDENTIFIED BY 'xbmcpassword';
GRANT ALL ON *.* TO 'xbmc'; --do this on both databases
XBMC will create the databases it needs.
3. Create advancedsettings.xml
containing this:
<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>***.***.***.***</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmcpassword</pass>
</videodatabase>
<musicdatabase>
<type>mysql</type>
<host>***.***.***.***</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmcpassword</pass>
</musicdatabase>
</advancedsettings>
5. Put advancedsettings.xml on the local home configuration area for xbmc
For Windows:
%APPDATA%\XBMC\userdata
For Linux:
~/.xbmc/userdata
Next time you open a XBMC client it will add all the tables and information by itself. No more configuration is needed.
6. Final point - Some concerns about the sources when using more clients
Sources concern 1:
The source paths you use must be available for any client in the same shape. Meaning you can't use a mapped network station on your windows client and then use the upnp streaming on the linux client. It just won't work because xbmc saves the full paths when a new file is discovered.
I use for example this path on all clients for the movies:
smb://SERVER/MEDIA/MOVIES
The EASY way to do this is to copy sources.xml and passwords.xml from the userdata folder referred to in 5.
Sources concern 2:
If you want all clients to be able to discover new files you MUST add the sources under Video or Music. And you must of course declare these sources the same way on all clients. For the same reasons as under sources concern 1. If you choose not to declare sources on one client, you will still be able to see all videos and music that is already added to the database. But you will then rely on another client to update the library when new files arrive.
Kommentarer
Legg inn en kommentar