Friday, 4 September 2015

How to retain your GUI settings in Kodi

When you restore Kodi or copy your existing Kodi userdata folder to another device it will always default the guisettings.xml, always. Even if you drop your previous settings into Kodi via a network folder, it will still reload it to default upon restart. This is because the guisettings.xml can't be written into the userdata folder when Kodi is running.

To prevent this from happening, overwrite the guisettings.xml with SSH using two programs. One to stop and start the Kodi process and one to copy over the backed up guisettings.xml file that contains all your GUI goodness.

1) Download and install these:
-- PUTTY
-- WINSCP

2) Turn on your sharing/ssh and whatever else...settings. Just make it so your Kodi machine can communicate with your network on all channels. Don't set any additional passwords. Leave it all default to make life easy.

3) Find and copy your guisettings.xml file (usually storage/.kodi/userdata/guisettings.xml). Put it on your desktop or somewhere where you can grab it easily.

4) Open up PUTTY.
A. SSH using PUTTY to the IP Address (Find it in your Kodi settings or your PC settings of the network folder) of your media center
[username: root, Password: openelec (if you use openelec) otherwise, it's blank or whatever shows in your ssh settings in Kodi]
B. Type "systemctl stop kodi.service" - Your screen will go black! This is normal. If it doesn't, something didn't connect.

5) Open WinSCP. Same IP, same username, same password. Note: If you get a popup about caching a host key, just say no for now.
A. Once logged in, navigate to the appropriate folder (usually storage/.kodi/userdata/) and drop your EDITED BACKUP guisettings.xml. You will get a popup asking if you want to overwrite the file. You'll know they're different, because the file sizes will be different. If they're the same, you probably copied the same or default file.
B. Hit the refresh button OR file/refresh to stick the file.

6) Hop on back to PUTTY and type in the following command "systemctl start kodi.service"

Your box will now reset. At this time, you'll either be back on your current skin or Confluence. If it's Confluence, change it back to your skin, and see if your old settings are there.

If you're using the Kodi/XBMC Backup Add-on, it will do 99.9% of the work for you as it creates a file called guisettings.xml.restored during the RESTORE process. In this case, stop Kodi using PuTTy as listed in 4B, deleted the file guisettings.xml and rename guisettings.xml.restored to guisettings.xml and then restart Kodi outlined in step 6. This is the method I used when copying my Openelec instance from a Zotac ZBOX to an Android powered G-Box Q.

Of course, if you are doing this on an Android box, there is no need to stop and start the Kodi process as you can simply close the Kodi app and then edit the guisettings.xml files located in Android/data/org.xbmc.kodi/files/.kodi/userdata/ with ES File Explorer after you've turned on 'Show Hidden Files' and 'Show check boxes' in the display options under settings. Note you'll also need a mouse or keyboard as controlling an app like ES File Explorer with an Android TV remote is neigh on impossible.

http://forum.kodi.tv/showthread.php?tid=218566&pid=1968291#pid1968291

UPDATE 3rd July 2016: If you are running a custom skin like I am (Xonfluence), you'll also need to backup and restore the settings.xml for that modded skin too. In my case, the settings.xml file is located in \\ip.address.of.your.pi\Userdata\addon_data\skin.xonfluence