Archive – Kodi remote database

Configure Kodi

  • In the Kodi GUI open the openelec Settings under Add-Ons/Programs
  • Open Network/Advanced Network Settings and enable Wait for network before starting Kodi
    • This is required as Kodi connects to the DB only during startup. Alternatively you can try the following command on other platform (haven’t tested it myself!):
sudo systemctl enable connman-wait-for-network.service
  • Create a new file named advancedsettings.xml
    • Using a standard openelec installation: Open SSH connection (root / openelec) and create ~/.kodi/userdata/advancedsettings.xml
    • Using a Windows Store installation: Put the file in %USERPROFILE%\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\userdata\advancedsettings.xml

Fill in the correct IP address of your SQL server and the password for your user kodi.
Btw: Synology uses Port 3307 for MariaDB 10 (instead of default port 3306)

<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>***.***.***.***</host>
    <port>3307</port>
    <user>kodi</user>
    <pass>**********</pass>    
    <name>kodi_movies</name>
  </videodatabase> 
  <musicdatabase>
    <type>mysql</type>
    <host>***.***.***.***</host>
    <port>3307</port>
    <user>kodi</user>
    <pass>**********</pass>
    <name>kodi_music</name>
  </musicdatabase>
  <videolibrary>
    <importwatchedstate>true</importwatchedstate>
    <importresumepoint>true</importresumepoint>
  </videolibrary>
</advancedsettings>

Restart Kodi to connect to the new database.

  • Check your log file for error messages
  • openelec installation: ~/.kodi/temp/kodi.log    
  • Windows Store installation: %USERPROFILE%\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\kodi.log

Hint: If everything runs successfully, Kodi v17 (Krypton) will create two databases named MyMovies107 and MyMusic60. The next version (as of Q2 2018 still in Alpha stage) will use different names. See: https://kodi.wiki/view/Databases

Clone your Kodi installation

Copy the following files (if present) to your your second / third … Kodi installation
  • advancedsettings.xml
  • sources.xml
  • mediasources.xml
  • passwords.xml
  • favourites.xml

2. For other Kodi clients to also benefit from the already downloaded/cached art thumbnails (untested!):

  • userdata/Database/Textures13.db
  • userdata/Thumbnails/*