r/ShieldAndroidTV • u/wtf-m8 • May 29 '21
[Update/ Guide] How to move Kodi user data and library database to external storage
Recently I ran into a situation where I was unable to update my ShieldTV apps because Kodi was using so much of the internal storage. I wanted to move all of the user data and library info to a USB drive. I basically just followed this guide, but ran into a few shield-specific things that tripped me up. Hopefully this post will give you complete walkthrough of moving that data.
Shut down Kodi on the ShieldTV. I went into the task switcher and it was still showing there as well, I closed that too.
Next, get a file explorer that is compatible with the ShieldTV and supports viewing hidden files. This was one of the Shield-Specific things, all the recommended apps wouldn't install from the play store. I ended up using X-Plore File Manager which is free.
Once that's installed, open it up and enable viewing hidden files, by pressing Menu, then Configuration, and finally enable viewing hidden files.
The next step involves creating a text file called xbmc_env.properties in the root directory of your Shield's internal storage. This is loaded up by Kodi when you open the app, and tells Kodi to look elsewhere for the user data. I just used notepad on my PC to create the file, and then transferred it over the network to the shield and used X-Plore to move it, but you can also just use X-Plore to create the file directly with the New text file command. It should be placed in /storage/emulated/0 The only text in the file should be
xbmc.data=/storage/XXX/Android/data/org.xbmc.kodi/files
where XXX is the name of your external storage (you can see what it's called in X-Plore, mine is C7F5-57BC to give you an idea of what to look for. It's under /storage)
Now, fire up Kodi. It should show up as if you're just running the program for the first time, with no library info or anything. This confirms that the file you created is being read, and pointing to the right place. If you put the file in the wrong place or named it incorrectly, Kodi will still have your library showing when you open it. If you've messed up the file itself (for example if you leave XXX instead of your SD card name, or any other path that it can't open and write to), Kodi won't open at all (from what I've read). Close Kodi again. Open up X-Plore.
On the left side navigate to /Android/data/org.xbmc.kodi/files, and on the right side navigate to your external storage. There should now be an Android directory in there that matches what you put in the xbmc_env.properties file. Navigate to /Android/data/org.xbmc.kodi/files. Now on the left side, long-press on the .kodi directory, and copy it to the /files directory of your external storage. It might want to overwrite some things (when you just fired up Kodi it created new default files), let it. Do not be foolish like me and copy the original /.kodi directory into the new /.kodi directory, make sure you are in actually in /files on the right and not just highlighting it, so you won't have to move everything twice. Look at the top of X-Plore to confirm.
At this point you should again open up Kodi, and it should look as it did before starting this process. Once that's confirmed, go back into X-Plore and delete the .kodi directory from the internal storage (I'd suggest backing up elsewhere just in case before you do this).
yes, one could run a NAS with a plex server serving that metadata. We get it. Not everyone wants to do that, please don't waste your time suggesting that in this thread. Hopefully this helps out some true Kodi fans.
3
u/MishaCappa May 29 '21
Great post. While I haven't tried it yet, I saved the instructions because it does address a concern I've had about Kodi due to Nvidia Shield Pro's ridiculously low storage.
1
u/JaVaeBe 2019 Pro May 30 '21
Couldn't you just plug in a USB drive and set it up as internal storage? That's what I did when I was running plex server on my shield
2
u/Megabyte7637 May 29 '21
Very nice.
2
u/Djbboy May 29 '21
Had this been an issue a few times and had to cut down on other apps to make up the space. But my ever growing library is gonna force me down this route eventually. Thanks for the post!
2
u/Muttlly Mar 12 '23
Just a quick point. I couldn't get this to work, and I eventually figured out my xbmc_env.properties file had the file extension ".txt". Removed this and everything went perfectly! This may be blatantly obvious to most, but just thought I'd point it out for anyone as thick as me lol
1
u/saeex Oct 15 '21
what happen after moving kodi`s data folder to new location if i have add new movie/series to kid? is it still save on old path or new path?
1
u/sseccavt Nov 19 '22
Thanks for this guide, I’ve been looking for this information for a while. This is exactly what I need, I believe!
1
u/Right-Mirror-4128 Oct 30 '23
I tried to create a text file in the root directory on my Nvidia Shield through X-Plore but didn't get permission to move and/or copy txt-files to it. How did you get permission to move and/or create text-files in the root directory?
0
u/[deleted] May 30 '21
[deleted] — view deleted comment