This guide was originally written for the Kodi 18 “Leia” release on Android, most also applies to other platforms.
Updated 28th July 2021 for Kodi 19.1 (Matrix)
Updated 9th May 2023 for Kodi v20.1 (Nexus)
Updated 26th March 2024 for Kodi v21 (Omage)
On a device with limited storage capacity, for example the Mi Box S which is an Android Box with only 8GB storage capacity (5.4GB available to apps), you will likely run into capacity problems when your Kodi library grows. You can either format a USB drive (or SD card if your device has a slot) as device storage and then move the entire Kodi app data, or just the Thumbnails
folder, to that drive or to an external (network) drive. If you are on a wired LAN there is a good chance that the Box can access a network drive faster than an attached USB drive, and it does not need to deal with encryption which is a good thing for a weak CPU.
Starting with Android version 10 it is not possible to access another app's user data due to the tightened security policy. Also, access to the device using SSH (e.g. starting an SSH server on the device) requires root access. If you like to modify a skin, or update the Kodi databases, then you need to move Kodi's configuration files to a storage space which you can modify.
There are 2 method's to deal with both on a Android platform.
Thumbnails
folder within Kodi's data space to an external device (USB drive, SD card, or network drive)Thumbnails
folder to a network drive put the following lines into file advancedsettings.xml
within the Kodi userdata folder:<advancedsettings> <pathsubstitution> <substitute> <from>special://profile/Thumbnails/</from> <!-- keep this exactly like this --> <to>smb://nas/media/kodi/machine/Thumbnails/</to> <!-- adjust to your file path on your NAS or server --> </substitute> </pathsubstitution> </advancedsettings>
Thumbnails
folder itself from the Box to the network location. This folder by far takes the biggest amount of Kodi's storage requirements, and in most cases is sufficient to give the device plenty of storage space back.Thumbnails
folder and the SQLite database TexturesXX.db. Do not share the Thumbnails
folder between different Kodi clients, as this will eventually take the clients where the SQLite database lives out of sync with the Thumbnails
folder.advancedsettings.xml
to external storage with Kodi's built in file manager, for example a USB drive (if the file exists in Kodi's userdata folder)dvancedsettings.xml
to Android's Main Storage
root folder, which can be written to by any appadvancedsettings.xml
as described in the steps aboveadvancedsettings.xml
back to Kodi's userdata folder with Kodi's built in file managerThumbnails
folder to the location you entered in advancedsettings.xml
with Kodi's built in file managerKodi
in the root of an SD card, or anywhere an another external device. Do not use the app's default location on the SD card as this path is not accessible as the kodi samba user since Android 11..kodi
folder from /storage/emulated/0/Android/data/org.xbmc.kodi/files
(you may find /storage/emulated/0/
also as Main Storage
) to the newly created Kodi
folder on the external device. If you have created or downloaded a customized skin it will also be copied, as it resides in .kodi/addons
. Refer to Skin for details.xbmc_env.properties
into the root directory of your internal (device) storage. This storage is writeable by FX File Explorer (Android). Create the file with the following line to tell Kodi where to find it's configuration folder:xbmc.data=/storage/<volume_id>/Kodi
Setting up and maintaining a well tagged video and music library with Kodi can be a lot of effort, particularly if you want to have it perfectly done, and the library grows big. I highly recommend to take a full Kodi backup after having completed the setup. The backup can then be used to restore or clone a Kodi installation. More advanced techniques are also discussed in my guide:
If you use different subnets in your LAN/WAN setup, then you might need to modify Kodi databases and xml setting files prior to restore (clone) a Kodi installation, under certain conditions:
<advancedsettings> <hosts> <entry name="hostname">192.168.1.12</entry> </hosts> </advancedsettings>
For a permanent change of the host name(s), refer to the following section Clone Kodi setup for different networks for a walk through. The steps required are identical, except that you must make sure all references to host names of the media servers (e.g. NetBIOS names) are replaced by ip addresses. This is necessary because the Samba client relies on broadcast and WINS which do not propagate host names across subnets.
Media server(s) on a different network almost certainly have different host names and are assigned different ip addresses within the network. To be able to clone a Kodi installation to a client on a different network all references to the media servers must be updated.
I have written a few batch files to automate the process, which are explained below. They work under “Bash” which is a linux command shell, and can be run on a Linux machine or under a Linux installation in “Windows Subsystem for Linux”. The following guide is for advanced users who know their way around Linux just enough to be able to run batch files under Linux.
~/batch/checkdb <database> <pattern>
“pattern” is the name of the host or the ip address of your media server. Do this for all databases in folder .kodi/userdata/Database.
$ ~/batch/checkdb MyMusic82.db hostname tables in db "MyMusic82.db", search "hostname" (pattern "/hostname/|@hostname/|%2fhostname%2f|%40hostname%2f") path: 1264 found source: 1 found source_path: 1 found art: 990 found
~/batch/checktable <database> <table> <pattern>
table is the name of the table as returned in the previous command. Do this for all tables of each database.
$ ~/batch/checktable MyMusic82.db path hostname fields in db "MyMusic82.db", table "path", search "hostname" (pattern "/hostname/|@hostname/|%2fhostname%2f|%40hostname%2f") strPath: 1264 found
~/batch/checkpattern <database> <table> <pattern>
~/batch/checkxml <file> <pattern>
Do this for all xml files in folder userdata.
~/batch/updateall <search_pattern> <replace_pattern>
“replace_pattern” is the new host name of your media server, or the new ip address to be used by Kodi.
cd \movieset\folder for /r %a in (poster.jpg) do C:\PortableCustom\ImageMagick\convert.exe -resize 500x750! -depth 8 -quality 80% "%a" "%a"
The new default skin “Estuary” is very good, not too heavy, and well maintained. However, it lacks the ability to customize the home screen. However, it is possible to customize the home menu items manually. With SSH access to your Kodi box, you can create custom menu entries. You need to be root to copy from the apk directory. Alternatively, you can copy from a rooted device, or a PC install, and then copy from USB to your media player, if the media player is not rooted.
; Android: su cp -R /data/data/org.xbmc.kodi/cache/apk/assets/addons/skin.estuary /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons ; LibreELEC: cp -R /usr/share/kodi/addons/skin.estuary ~/.kodi/addons
; Android: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/skin.estuary.mod/addon.xml ; LibreELEC: ~/.kodi/addons/skin.estuary.mod/addon.xml
; Android: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/favorites.xml ; LibreELEC: ~/.kodi/userdata/favorites.xml
; Android: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/skin.estuary.mod/xml/Home.xml ; LibreELEC: ~/.kodi/addons/skin.estuary.mod/xml/Home.xml
; Android: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/skin.estuary.mod/language/resource.language.en_us ; LibreELEC: ~/.kodi/addons/skin.estuary.mod/language/resource.language.en_us
; Android: /data/data/org.xbmc.kodi/cache/apk/assets/media /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/media
Refer to the example file home.zip which contains custom menu items replacing the games entry. Note id 52 below, which is the id of the favorite selected.
<item> <label>$LOCALIZE[20389]</label> <property name="menu_id">$NUMBER[17000]</property> <onclick>ActivateWindow(10025,"videodb://movies/sets/52/?setid=52",return)</onclick> <thumb>icons/sidemenu/musicvideos.png</thumb> <property name="id">games</property> <visible>!Skin.HasSetting(HomeMenuNoGamesButton)</visible> </item>
In my setup, it is Concerts(1), Billiard(2), Thai movies (8), 3D(53).
Kodi 19 introduces a central movie set artwork folder. Prior to that, movie sets got their artwork from one of their movie members, but this does not work anymore in Kodi 19 beta2. I use tmm (tiny media manager) to create artwork, which also adds movieset artwork. This is how to extract the movieset-poster.jpg and movieset-fanart.jpg files from the movie folder and move them to a central artwork folder.
$ cd /your/movies/root/folder $ find . -name 'movieset-poster.jpg' -exec cp --parents \{\} /path/to/moviesetart \; $ find . -name 'movieset-fanart.jpg' -exec cp --parents \{\} /path/to/moviesetart \; $ cd /path/to/moviesetart find . -name '*.jpg' -exec bash -c 'filename="{}"; mv "$filename" "${filename//movieset-/}"' \;
In addition, you need to create file advancedsettings.xml in the userdata folder with the following content
<advancedsettings> <videolibrary> <moviesetextraart> <arttype>poster</arttype> <arttype>fanart</arttype> </moviesetextraart> </videolibrary> </advancedsettings>