This is my first post here, and I’m a relative fresh user of kodi.
I’m installing over 40 boxes and I would like to setup our mediaserver as a MySQL database.
From before the server is setup with Jellyfin and contains over 5000 movies and around 200 different TV shows.
I’ve now installed MariaDB and got one box sat up to connect there by FSTAB mounting the NAS drives connected to the mediaserver, and I get the osmc box to read and write to the database.
The question now is, can I use one box as a Master box for the DB so the other boxes just follow the database?
I use Jellyfin for the online datacollection creating NFO fanart posters etc. so the media is allready sorted and contains all data. I found the feature when setting up the first omc box to prevent osmc/kodi to look for data online and just read the local data. Excellent.
What I’m trying to avoid is over 40 boxes connecting to the server and downloading data.
I understand I can copy the files via WinSCP and implement them in each box, anyway I have to establish the FSTAB mounts on all boxes to get them to communicate perfectly with the mediaserver. so thats not the issue. I’m just asking how to best set it up to have on Master OSMC to rule them all.
Please feel free if anyone has any inputs on better ways to set this up.
And yes, I’ve tried both the Jellyfin for kodi add-on’s and half of the media won’t play, so thats not a good option.
Thank you for reading, and even bigger thanks if you contribute to my hopefully successful setup.
Yes, that is the concept of using a central MySQL database. You use one machine to organise and scrape the movies into your database and all the others are using the same database and information.
Just ensure that they all can access the movies in the same way or you would need path substitution
Just configure all of them to use the central MySQL database. If they all have the same paths in fstab it will directly work
I’m glad to hear all has been received well.
Do you have bandwidth limitations? If so, we have a method of caching APT (operating system) updates such that a single device can store updates and distribute them across devices on the network automatically. We have set this up for a Norwegian cruise ship company in the past and the requirements are modest: just a Linux VM with about 20GB space.
Otherwise, @fzinken’s advice is sound.
Yes, everything well recived. Thanks for that.
Yes we have bandwith limitations. we have in worst case 10% of 4mbits availiable for these units. Best case we have 6,5mbits.
The possibility to do the updates from one unit would be amaizing. Right now I have to manually update every unit since they shipped with the August update, hence the email asking for the image earlier. I only found august update under download section.
How do I prevent the other boxes that are not supposed to be able to add other media from doing this then?
Obviously I can setup a different user with just read privelegies, but I’ve never tested this before, and wanted to check with someone here on the forum for some advice on how to set it up in the best way possible. and do it once.
Since there is so many boxes I just want to do it once and do it right
If you don’t add the sources on them they will not have anything to scrape. Just pointing them to the MySQL Database will them just play what is listed in there scraped by the main machine.
Just copy the fstab file between them and also just use the same advancedsettings.xml for all of them. Just don’t copy the sources.xml
Now I just have to wait for @sam_nazarko to tell me how to setup the system he was talking about for updates.
As I understood the boxes must all be the same software to be able to share db?
I’m guessing what you probably want to do is configure a user profile that shares the library with the master user but has all the access to things removed. If someone tries to access things that are locked out like the settings then it gives a password prompt before they can continue. It is all pretty self explanatory once you start looking at the options after adding a new profile. I use this on a couple of the boxes in my house and haven’t run into any issues so far. Once you disable things in the UI like the adding source option and the videos menu then you can make the UI pretty narrow and keep it that way by locking the settings. The only caveat here is that if you really want to keep it limited then make sure to not enable the web ui as that is an easy backdoor to the settings.
You will also probably want to install SMB server on all of them so you can just make one master .kodi folder and then just copy that to each over a network connection. At least that is the way I do it. You will need to ssh into the boxes and
systemctl stop mediacenter before the transfer otherwise your UI settings will not get applied.
They only need to be running the same major Kodi version (ie v18.x, 19.x, etc.) in order to be on the same database. You can run it mixed but the databases as forked so would have to be updated individually and would have different watched status.
Speaking of watched status, this is a bit of a downside to how MySQL works with Kodi. In order to have one database that gets updated centrally then your stuck with a shared watch status. The only way to get individual watched status with MySQL is for all of them to run their own db which means they all have to update.
They must be all on the same major Kodi version as that normally is when database format changes.
So if some boxes are 19.0 and others are v19.3 that would be fine. Just if some older boxes are on v18 they would see a different database.
But anyway having them all same update is the best.
As you have 40 boxes you might want to look into ansible or multi-ssh for automation.
I’ve replied to your email that you sent this evening.
There will be a newer image on the Download page shortly. In the interim, I’ve sent you a direct download link.
Yes, when using MySQL. But worst case scenario is that older systems won’t get updated library details.
I’ve sent you a file. Try it on one box. It looks like the last time I made a change to it was the end of 2019; so it may not work on Buster. If you’d prefer, I can test and renew it later after verifying it and getting some internal testing done.
Thanks a lot for the information.
I think I’ll stick with WinSCP that gives me the features I want and i prevent the units from beeing accesible on the network as well.
I’m setting up 2 profiles on each unit since we have 2 people sharing cabins sometimes. That way they can have their own profile in a way.
Wich files do I need to copy from the first unit that is sat up the way I want?
Everything in .kodi/userdata/ - Except sources?
I want them all to look just the same way and have 2 profiles, and a master profile that is locked with a password. I think I’ve sat that up correct on one box now, so now I only need to compy this onto my server and then start unpacking the rest of the boxes
I think you would be best served by just dealing with the
~/.kodi folder as a whole instead of having to learn what the individual files are. As for the profiles I’m not sure you want two. The reason for having the second one is to gain the ability to lock the unit. Since Kodi does this only by setting a password/pin on the master account this also means that without a second account you couldn’t get into Kodi without said pass/pin at all. So having the second user it allows a locked down UI with no password need for use at all. The only reason really to have a third account would be if you were allowing people to maintain their own watched lists. This is possible but with two individual users on 40 boxes this means that your going to be using 80 different dbs each with their own db names and all of which have to be updated individually. Although this is possible, it kind of removes the reason for running the central db in the first place. If you wanted something like that then just skip MySQL and setup sources for local files only and to auto update library. You would just need to make sure that you maintain local files like you said you already are.
I don’t think there is a reason to exclude sources. Not as in that it is bad, just that it doesn’t matter if you lock the UI out of adding sources and the scraper is set to local info only. If someone kicks off a library update everything is local so what is the harm.
Just to add on one more tidbit here is an article on disabling the auto setting of watched status which may be desirable with a bunch of people on a single db.
Actually I think you’re right. We have a few of those boxes that could benefit from having a synced db, but I think the majority would benefit from having their own.
I found that it’s possible to run a backup from the osmc box to a usb stick, that contains fstab and everything.
I’ll try that on a few boxes that are sat up correct, and we’ll see.
If that does not do the job I’ll do it trough WinSCP.
If @sam_nazarko can provide me with some guidance on how to setup an offline updating system for them aswell I think we have a perfect setup
Any tips and tricks are appreciated here, so everyone that has an idea or experience that they want to share, feel free