Shared Database on Different OSs

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
nick3young Offline
Junior Member
Posts: 42
Joined: Dec 2010
Reputation: 0
Post: #1
Hi All,

I've read countless threads on sharing the XBMC database across different devices using MySQL. Just to be clear, I'm not talking about media but instead the metadata (e.g. watched movies, 'continue watching from...' etc etc). I have learned that, for it to work, the XBMC version must be exactly the same on each device. But what I can't find anywhere is, can the same version be on different operating systems and it still work?

I use a Synology NAS box with My SQL and the XBMC database on it. I managed to populate it with entries from my Windows 8.1 media centre. Then I connected my Raspberry PI to the shared database, which seemed to work... but when I went to my Windows computer, the media was being displayed very strangely!

Has anyone managed to do this?

Thanks
Nick
find quote
prae5 Offline
Team-XBMC Forum Moderator
Posts: 2,089
Joined: Jan 2009
Reputation: 34
Location: Cambridge, UK
Post: #2
Providing all of your clients run the same version of xbmc you will be fine. I run windows, osx and a variety of linux clients without issue.

You only start to have problems when you mix different xbmc versions as they can use different database schemas.
find quote
nick3young Offline
Junior Member
Posts: 42
Joined: Dec 2010
Reputation: 0
Post: #3
Ok thanks - that's what I wanted to hear! Perhaps the version numbers were incorrect then (but I'm sure that I checked). I will do a little more investigating.....

Cheers
find quote
protocol77 Offline
Fan
Posts: 633
Joined: Jun 2011
Reputation: 2
Post: #4
i can confirm this works fine also i have a mix of windows htpc's and openelec (linux) and they all connect to my server running Windows Server 2012 with mysql installed
find quote
mason Offline
Senior Member
Posts: 295
Joined: Sep 2008
Reputation: 0
Location: Germany
Post: #5
also your sources must match on different OS. So make sure all sources are available under the same protocoll or use pathsubstitution to match your source files.
find quote
MilhouseVH Offline
Posting Freak
Posts: 3,018
Joined: Jan 2011
Reputation: 71
Post: #6
You also only need a sources file set up on the"scraper" client - it's not required at all on any client you don't plan on using for scraping.

Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
find quote
nick3young Offline
Junior Member
Posts: 42
Joined: Dec 2010
Reputation: 0
Post: #7
Thanks for the replies everyone.

My Windows 8 box and Raspberry Pi are now both displaying my media correctly. However, my Pi isn't showing the ticks for what I have seen or continuing from where I left off on the Windows computer. I have added the advancedsettings.xml into this location on the Pi: /home/pi/.xbmc/userdata. The xml file contains this:

<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>***.***.***.***</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</videodatabase>

This is working fine on my Windows computer. On the XBMC 'how to wiki', it mentions having to add this to the xml also:

<videolibrary>
<importwatchedstate>true</importwatchedstate>
</videolibrary>

Is this necessary?

Also, I'm a little unsure as to how all this works! From what I have read, since v12, XBMC doesn't keep the media in the mySQL database... it instead caches it locally to improve performance. Does this mean that when both are working, the Pi and my Windows computer will both have their own local copies of fan-art etc?

And MilhouseVH... how do you designate which is the scraper? When you add a source, you have to enter the media type (e.g. movies)... should I only be doing this on one of the devices?

Thanks
Nick
find quote
MilhouseVH Offline
Posting Freak
Posts: 3,018
Joined: Jan 2011
Reputation: 71
Post: #8
(2014-03-07 15:18)nick3young Wrote:  Thanks for the replies everyone.

My Windows 8 box and Raspberry Pi are now both displaying my media correctly. However, my Pi isn't showing the ticks for what I have seen or continuing from where I left off on the Windows computer. I have added the advancedsettings.xml into this location on the Pi: /home/pi/.xbmc/userdata. The xml file contains this:

<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>***.***.***.***</host>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</videodatabase>

Maybe just a typo in your post, but you are missing the closing </advancedsettings> tag. Check xbmc.log on the Pi to make sure the advancesettings.xml file is being read correctly - it sounds like it is though.

One other thing, is your Windows PC and Raspberry Pi running the same version of XBMC? Different versions of XBMC use different database schemas and you might be using a more recent version the Pi which has created a new database schema (from the version created the Windows PC) so now your PC and Pi are no longer synced, they're using two different databases again. Solution would be to upgrade Windows to the same version of XBMC used by the Pi, or downgrade the Pi to the version used by Windows (and drop the databases created by the Pi).

(2014-03-07 15:18)nick3young Wrote:  This is working fine on my Windows computer. On the XBMC 'how to wiki', it mentions having to add this to the xml also:

<videolibrary>
<importwatchedstate>true</importwatchedstate>
</videolibrary>

Is this necessary?

No, that only applies when importing the watched status from NFO files and has nothing to do with MySQL.

(2014-03-07 15:18)nick3young Wrote:  Also, I'm a little unsure as to how all this works! From what I have read, since v12, XBMC doesn't keep the media in the mySQL database... it instead caches it locally to improve performance. Does this mean that when both are working, the Pi and my Windows computer will both have their own local copies of fan-art etc?

Yes.

The script in my sig can help optimise performance of the cache on each client. The cache on the client(s) used to scrape the library will be populated as part of the scraping process, but the caches on your other clients will not contain any of the artwork for newly added media until you display each item in the GUI - this can result in noticeable delays as the missing artwork is fetched, resized/resampled and then cached before finally being displayed (hence the script).

(2014-03-07 15:18)nick3young Wrote:  And MilhouseVH... how do you designate which is the scraper? When you add a source, you have to enter the media type (e.g. movies)... should I only be doing this on one of the devices?
I would, but you don't have to. I just think it makes more sense to have a single "scraper" client, typically your most powerful client but it could also be a Pi particularly if your scraping is fully automated in which case an always-on client is more useful.

So how you choose which client is your scraper is up to you, I was simply pointing out that you only need the sources.xml defined on the client(s) that will be doing the actual scraping. If that is all of them, then make sure they all have the same sources.xml.

My approach is to scrape new media using a Pi which adds the new movie/episode to the library, then run any addons on the Pi to grab extra artwork or metadata (eg. Artwork Downloader for logos, clearart, etc.) and then finally update the texture cache of all my other clients so they have all of the new artwork in their cache. This is all fully automated from a job running on my NAS and the script in my sig.

Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
find quote
nick3young Offline
Junior Member
Posts: 42
Joined: Dec 2010
Reputation: 0
Post: #9
Thanks for your detailed reply Millhouse. It has helped me understand everything a lot better.

I have also got to the bottom of (or close to) what has been causing the problem. Although I could be wrong, I believe it has something to do with the speed at which my Windows 8 computer is connecting to my NAS.

I have been having a problem previous to this where I turn my computer on and select a movie to watch before receiving an error "the title no longer exists, would you like to remove it from the database". If I leave it 30 seconds and then go to a different source (e.g. TV Shows), it then plays the file. If I then go back to Movies, it will then play. A little odd? But I think the same issue is causing my problem here. When I start the computer up and go into Movies, everything looks blank (no thumbs, fan art, titles... nothing). But if I restart XBMC (not the computer) it then displays all of my media fine.

My NAS is a 'Synology DiskStation DS213j' with 2x Western Digital Green. Though it is a pretty decent NAS, I just wonder if its energy saving mode (particularly because the drives are the 'Green' flavour too) is taking a little too long to establish a connection with my system. I had a Buffalo Terastation NAS before the Synology and never encountered these issues then......

After the 2nd load of XBMC everything is working perfectly. What do you think? Thanks.
find quote
MilhouseVH Offline
Posting Freak
Posts: 3,018
Joined: Jan 2011
Reputation: 71
Post: #10
If you are getting timeouts and other errors when connecting to your NAS, you should see some evidence of this in your xbmc.log. Enable debugging, then upload your debug log once you have experienced a connection error and someone in the forum might be able to shed some light on the problem.

Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
find quote
nick3young Offline
Junior Member
Posts: 42
Joined: Dec 2010
Reputation: 0
Post: #11
Thanks for all your help with this.

I felt it would be tidier to start a new thread following on from this issue as it was starting to stray a little far from my initial question. I am also having a few other 'startup' issues which I wanted to bundle into the same thread.

I have started it here.

Thanks again
Nick
find quote