Mysql library (migrating from pi2)

I have just set up my Vero 4K+. Everything is working except the mysql library and I hope someone can help me to set this up. Found a few posts but some are from people moving over from a pi2, I still have a pi2 running so need it to work on the Vero and the pi2.

Setup
Mysql running on Synology NAS, Libreelec on two raspberry pi 2’s. It has been working this way for over a year now and I just replaced on pi 2 box with a Vero 4K+ to handle 4k movies.

What have I tried
I initially copied over my advancedsettings.xml file (from Pi 2), hoping it to work but it doesn’t. It does show my library items, but I can’t play anything. When I click a file I get: “file no longer available, would you like to delete it from the library”. I am quite sure this is related to the Vero not using SMB. I have succesfully added all NAS folders via mounting but that was not how they were connected on the pi 2 (still are connected on the other pi2). If I browse to the videos in file mode they play, I just think the library doesn’t link them anymore / can’t find the files where it expects to find them

Help needed
As I still have my other pi2 (the major point for me in mysql is tracking playback progress across devices) I will probably need to change something on the Vero and/or the pi2 but clueless where to start and how to keep it working on pi2 and Vero. I read a few posts on pth substitution but ot sure how that works. Saw another post on storing passwords in a password.xml file but with Vero not supporting SMB not sure if that will ever work

My advancedsettings.xml (taken from working pi2)

<?xml version="1.0"?>
-<advancedsettings>
-<videodatabase>
<type>mysql</type>
<host>192.168.178.26</host>
<port>3306</port>
<user>kodi</user>
<pass>kodi</pass>
<name>kodi_video</name>
</videodatabase>
-<musicdatabase>
<type>mysql</type>
<host>192.168.178.26</host>
<port>3306</port>
<user>kodi</user>
<pass>kodi</pass>
<name>kodi_music</name>
</musicdatabase>
-<videolibrary>
<importwatchedstate>true</importwatchedstate>
<importresumepoint>true</importresumepoint>
</videolibrary>
</advancedsettings>

My mounts to my NAS, passwords replaced
//192.168.178.26/video /mnt/NAS_Video cifs x-systemd.automount,noauto,rw,iocharset=utf8,username=mediauser,password=****,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0

//192.168.178.26/music /mnt/NAS_Music cifs x-systemd.automount,noauto,rw,iocharset=utf8,username=mediauser,password=****,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0

The Video mount contains several folders, mainly “Movies” and “Series”, that is where the movies and tv shows are physically located

Need help please

Not really sure how to proceed. On the pi2 this just works, no special need to map sources in a special way, I think the library just gets links via SMB and opens them but not sure. Any suggestions on how to proceed are welcome.

What version of LibreELEC (in turn Kodi) are you running?

Make sure that the MySQL server allows the new host (The Vero) to connect.

Have you verified from a command line that you can actually access the fstab mounted shares?

One other thing, is there a formatting problem when you copied the advancedsettings to the forum? That is not a proper XML file the way it shows.

When you use a shared MySQL library, all devices need to see the video files using the exact same paths. The error you are getting shows the device running OSMC does not use the same path to access the NAS as the LibreElec device does.

Change the paths on the OSMC device to exactly match those on the LibreElec device, and all should work fine.

Thanks all.

  • List item Yes the xml is better formatted here, trying out how to paste here. I can play all files via Videos, file mode - browsing to the files themselves.

  • List item Running Libreelec 9.02 (Kodi 18.2)

  • List item “Change the paths on the OSMC device to exactly match those on the LibreElec device, and all should work fine” - I think you are spot on here, however I don’t know how to do that. Today is the first time I mounted in linux. On the Pi2 there is no mount, only a source which I browse to and add as source and then it all works. Could you point me how to try this? does the name of the mount matter? So what I now named “/mnt/NAS_Video” ? that part has no ip adress or server name, that is what confuses me. I could also make direct mounts to the movie and series folder inside the video folder.

Update - just mapped the folder video/Movies and video/Series directly via a mount, then adding a source. I can browse, select and play my movies and tv shows here but the library still doesnt work. Here is the code I used to map in /etc/fstab

//192.168.178.26/video/Movies /mnt/NAS_Movies cifs x-systemd.automount,noauto,rw,iocharset=utf8,username=mediauser,password=****,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0
//192.168.178.26/video/Series /mnt/NAS_Series cifs x-systemd.automount,noauto,rw,iocharset=utf8,username=mediauser,password=****,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0

This post MySQL Library Not Showing, Updating or Cleaning - #18 by fzinken mentions path substitution but unsure how I should set that up? the post is confusing to me

Well you always can/should use the local folders if you use fstab based access. So you then would use path substitution to ensure all clients
http://kodi.wiki/view/path_substitution

Add sources on the OSMC device that exactly match those on the LibreElec device. It would be in “Settings->Media->Library->Manage Sources->Videos”. Look at the settings for each source on the LibreElec device and create sources that match each one on the OSMC device. The LibreElec device might have fstab mounts behind the scenes, and those would have to be exactly replicated on the OSMC device. OTOH, if it uses Kodi’s smb: or nfs: protocol, you should be able to enter that into the OSMC device directly in the source configuration screen.

There are other solutions using path substitution, but since both boxes run a version of Linux, it’s better to have them exactly the same.

Thanks, first attempt failed.

This is the source on my libreelec box
1%20libre !

I typed it on the Vero
2%20osmc

But then I get
3%20osmc

Think I read somewhere that on the Vero the user and pass need to be in the SMB URL, will truy that next.

Actually I got this error this morning during first setup, and thats why I moved to mounting to get access to my files. Not sure how to say this (linux noob) but it looks like the Vero won’t access files the same way my pi does (or the other way around) and I think that is causing the issue,

You should be able to fix this by copying the userdata/passwords.xml from the Kodi directory on the LibreElec to /home/osmc/.kodi/userdata on the OSMC box.

Thanks again, just came to share another update. I added my video share using this format as outlined in the wiki: “smb://user:password@SERVER/sharename/folder”. Long password so took me a while with the remote (no keyboard near).

After this the library works again. For both Movies, Tv Shows and - for me funnily - also for music. Seems that the password for the whole server is only needed once, other shares now work without user:password in the smb url.

I also removed everything in fstab to do some cleanup. And readded the pictures and music share via smb as well, only these don’t need the user:password.

Thanks to all, learned a lot today. Seems more roads lead to rome (smb paths, fstab and mounts and password.xml files). Appreciate the help!