My home setup is a little different from most, but still a supported solution. It involves a central MySQL server on the main household server, media also stored on that server and accessed via NFS, and media playback via Kodi on generic x86/x64 hardware that mounts the above NFS shares and stores Kodi metadata on the MySQL server.
This allows a shared store of playback states, and also a shared store of media information for use by other apps such as Jellyfin, Sonarr, Radarr, etc.
I wished to move to LibreElec just for simplicity sake. I was growing tired of a small form factor PC sitting in the AV cabinet, the Raspberry Pi ecosystem had grown dramatically since I’d made the x86 decision about ten years ago, and the Pi4 finally had enough horsepower to decode 1080p content. I may need to revisit this decision in the years to come when I upgrade to a 4k or 8k television. Additionally, it’s been 6 months since Kodi 19 was released, and it’s not available for the Pi4 yet, but LibreElec Beta with Kodi 19 is.
The first hurdle I had to overcome were the paths that are stored inside the Kodi database. Since the NFS share is mounted at /media/store/, every media file that Kodi refers to in the database has this path. Since LibreElec not permit any filesystem manipulation outside of /storage, a new location will have to be found, and the database will need bulk edited.
To mount the NFS share in /storage/store/, first create the required directory and then create the systemctl unit file as /storage/.config/system.d/storage-store.mount
Description=nfs mount script
The new storage mount can now be started by systemctl
systemctl enable --now storage-store.mount
Now to edit the database. There are two tables of importance that I know of – movie and path, within the MyVideos database. MyMusic is also somewhat important, but as I’m really only interested in saving watched status, playback position, etc, it’ll be ok to reimport the Music store.
I use DBeaver for my database manipulation
The following SQL statement will change all the paths within the table
Update the movie table
update movie set c22 = replace(c22,'/media/store/','/storage/store/');
Update the path table…
update path set strPath = replace(strPath,'/media/store/','/storage/store/');
Update the art table
update art set url = replace(url,'/media/store/','/storage/store/');
Update the episode table…
update episode set c18 = replace(c18,'/media/store/','/storage/store/');
With the new storage location present, and the database now referencing the correct locations, it’s just a case of rebooting the machine and checking the state of a few sample items.
edit: I later found out that the media locations set up within Kodi were wrong or missing. I simply removed the problematic media sources, without deleting them from the library, and re-added them with their new location. This then allowed the automatic library updates to resume working as intended.