2 XBMC PCs and 1 Database on the shared NAS

  Thread Rating:
  • 7 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
rtrimarchi Offline
Member
Posts: 69
Joined: Mar 2010
Reputation: 0
Post: #1
Hello everyone Big Grin

I have 2 HTPC and 1 NAS in my house.

I am trying to have these 2 HTPC share the same settings and database and fanarts and JPegs located phisically on the NAS.

(right now these HTPC are 2 independent PC)

This is to avoid to manage 2 HTPC databases.....since all the movies are on the common NAS shared via SMB.

Can you guys point me to the right direction on how to do it Confused

Thanks a lot.....
Rick Wink
find quote
charrua Offline
Senior Member
Posts: 273
Joined: Nov 2008
Reputation: 13
Lightbulb    Post: #2
There is a new feature already implemented in XBMC(since svn r28142) that lets you use a central MySQL database for all your clients.
The basic steps you need to do in order to use it are:

1. Setup a MySQL server (a database server) accesible from all the machines running XBMC. Even some NAS support running MySQL server, so an option is to run the database server directly on your NAS (if you have one that supports it) or run it on any machine that you want (MySQL server is freeware and supports lots of OSs).

2. Modify your advancedsettings.xml located in the userdata folder of XBMC adding this lines:
Code:
<videodatabase>
  <type>mysql</type>
  <host>localhost</host>
  <port>3306</port>
  <user>xbmc</user>
  <pass>xbmc</pass>
  <name>xbmc_video</name>
</videodatabase>
where:
host is the network address of the server running MySQL
port is the port used by the MySQL server (default is 3306)
user and pass are the credentials used to connect to the MySQL server
name is the name of the MySQL database you want XBMC to use (it must be all lowercased)
(you don't need to create the database, XBMC will create it for you the first time you run it after modifying the advancedsettings.xml).

You can also setup a central database for music albums, you need to add these additional lines to your advancedsettings.xml:
Code:
<musicdatabase>
  <type>mysql</type>
  <host>localhost</host>
  <port>3306</port>
  <user>xbmc</user>
  <pass>xbmc</pass>
  <name>xbmc_music</name>
</musicdatabase>
The same explanation given for videodatabase applys here, just one more thing: you can't share the same database for music and video, so just pick a different name for each database (also all lowercased)
Remember to modify the advancedsettings.xml of each XBMC you intend to share the MySQL database with.

Some advantages of this setup:
Every PC or MAC running XBMC can access that central database even simultaneously (instead of using a local database for each instance of XBMC), avoiding the need to scrape movie info once per each XBMC. Also sharing the info of watched/unwatched movies/tvshows/musicvideos and any other info that XBMC stores in the media library database (like stop/resume bookmarks).

For more info, trobleshooting and details you can check this thread (readers beware: it may be a bit technical (it's in the developers area of the forum)).
(This post was last modified: 2010-03-23 16:36 by charrua.)
find quote
nabz Offline
Member
Posts: 83
Joined: Sep 2007
Reputation: 0
Location: Spain
Post: #3
Thanks charrua for the reply
I have some questions about this:
1.- Will it work if I use XBMC from XBOX and from HTPC? I know the video database schema used by XBOX is older...
2.- What about BD migration? I mean: move all from the local DB to the central DB.
3.- What we have to put the tbn files?

Thanks!
find quote
charrua Offline
Senior Member
Posts: 273
Joined: Nov 2008
Reputation: 13
Post: #4
nabz Wrote:Thanks charrua for the reply
I have some questions about this:
1.- Will it work if I use XBMC from XBOX and from HTPC? I know the video database schema used by XBOX is older...
2.- What about BD migration? I mean: move all from the local DB to the central DB.
3.- What we have to put the tbn files?

Thanks!

1.- It hasn't been ported to the XBOX branch
2.- Your best option at the present time is to export the libraries from XBMC, then change the DB to MySQL and then reimport from XBMC. A Python script for DB migration would be very welcome though. Smile
3.- I think that the best place for the tbn files are in the same folders where the media files are located. Additionally when exporting the DB you can also export the tbns and fanart so they will be cached again when importing the movie/tvshows info. However there is still a problem that it is being discussed about thumbnails: when you first access the central MySQL DB from a XBMC client that is not the one that scraped the media files, there are problems in the thumb cache generation, because the URL of the thumbs are not stored in the DB (at least in the current version of XBMC) however they are working on a solution.
find quote
nabz Offline
Member
Posts: 83
Joined: Sep 2007
Reputation: 0
Location: Spain
Post: #5
Thanks for your reply Big Grin
I'll wait for coming news... Wink
find quote
bradvido88 Offline
Donor
Posts: 736
Joined: Nov 2008
Reputation: 7
Location: MN
Post: #6
I'm using this solution and it is pretty great. The thing that will make it kick@$$ is when the thumbs/fanart gets rolled into it.
Current i still have to do a manual update on all my XBMC instances in order to keep fanart updated in all.

XBMC.MyLibrary (add anything to the library)
ForTheLibrary (ForTheRecord & XBMC Library Integration)
SageTV & XBMC PVR Integration
Delete unused thumbs
find quote
charrua Offline
Senior Member
Posts: 273
Joined: Nov 2008
Reputation: 13
Post: #7
bradvido88 Wrote:I'm using this solution and it is pretty great. The thing that will make it kick@$$ is when the thumbs/fanart gets rolled into it.
Current i still have to do a manual update on all my XBMC instances in order to keep fanart updated in all.
There are two alternative methods for that right now:

a-Copy the thumbnails folder from the XBMC where you scraped the media files and paste it into the XBMC userdata folder of the other XBMC clients.

b-After scraping new media files, in the other instances of XBMC (not the one that scraped the files) go and browse the new files in file-view (instead of library-view).
find quote
bradvido88 Offline
Donor
Posts: 736
Joined: Nov 2008
Reputation: 7
Location: MN
Post: #8
charrua Wrote:b-After scraping new media files, in the other instances of XBMC (not the one that scraped the files) go and browse the new files in file-view (instead of library-view).
What does this do? I'm not sure I understand how it will get the thumbs/fanart/actor images by doing this.

XBMC.MyLibrary (add anything to the library)
ForTheLibrary (ForTheRecord & XBMC Library Integration)
SageTV & XBMC PVR Integration
Delete unused thumbs
find quote
rtrimarchi Offline
Member
Posts: 69
Joined: Mar 2010
Reputation: 0
Post: #9
charrua

let me give you a quick THANKS for now.. Wink

I will give it a try in a couple of days......

for now I just say THANKS to you all guys for the great info Wink

rick
find quote
charrua Offline
Senior Member
Posts: 273
Joined: Nov 2008
Reputation: 13
Post: #10
bradvido88 Wrote:What does this do? I'm not sure I understand how it will get the thumbs/fanart/actor images by doing this.

Well, in my case, I have the tbn files and fanart stored along with the media files, so if I browse the path of the media source in fileview mode, XBMC stores the tbn and fanart(not actor images though) in the local cache, so I don't need to scrape all media files again or update the thumbnails manually.
find quote
Post Reply