How to save your Kodi library

How to save your Kodi library so you never have to download it again!

Yep, you read that right! Actually, this guide does away with exporting and importing mostly. I got tired of waiting for my large collection to download every time I did an upgrade or removed a Kodi source/share. And it wasn’t too hard to figure out a way around it.

A nice side effect of this guide is that you will easily be able to tell which content is not being detected by Kodi. You may not realise it, but if you have a large collection, often Kodi doesn’t detect things and there doesn’t seem to be any reason to which it will or won’t detect during the library scan, but it can miss quite a few things off from time to time. Another nice side effect of this method is that you won’t have issues with path incompatibilities (causing your Kodi library import to fail) if you’ve changed your sharename, have multiple Kodi clients etc.

OK, you’re not going to believe how easy this is. 🙂

First off, you’re going to need to do a library scan from the internet, once, as per normal.

Add items to your Kodi library

From the main screen go to video. Click or press Enter on the Add source item and add a media source if you don’t already have one.

Ensure you go into “Set Content” and change the item, “This directory contains” to Movies or whatever content you have in your source. If you already had a source set up, you will need to edit it by selecting it, pressing C (or right clicking the mouse) and choosing edit source.

Also make sure you select, “Run Automated scan” and “Scan Recursively”, under Settings to ensure you have “enable fanart” enabled. Click OK twice to get out.

If you were creating a new source it should now scan it automatically. If you had an existing source you may need to select it, press C (or right click) and choose, “Scan for new Content” as sometimes they don’t accept the automated scan request. Note: It is not until you do this scan that the Kodi Library Mode will become active.

Depending on the size of your library and speed of your internet connection, you may need to wait a while, maybe even an hour . When it’s completed, select and make active the Library Mode item under Video. At this point you should be seeing a screen with Movies, Recently added movies and Playlists on it. Click on Movies, then Title and you should be looking at the the glorious Kodi Library goodness!

Exporting your library

OK so you’ve spent an hour waiting for your library to download and you know you don’t ever want to do that again! The fix is quite easy.

Ensure you have write access from Kodi to where your library is stored. If you are running from a Samba share you will need to ensure the user you are connecting to the share as, has read, write and execute access, otherwise this will not work.

In the Kodi library, press C or right click and select settings.

Scroll down and select the Library Menu Item, then choose Export Video Libary.

Choose to export your library to separate files per entry (this bit is the magic)

Choose yes to export thumbs and fanart

Choose yes to overwrite old files.

The export now begins. Once the export has completed, you’re actually done and you never ever need to go into, “Import Video Library” again!

How does this work? It works because beside every file in your network share or disc folder/directory, the export put’s some matching files beside your movie files indicating to Kodi that this is the fanart, cover image, actors, directors, IMDB rating etc etc that belongs to this movie. When Kodi is newly set up, all you need to do is go through the add items to your library section above and Kodi automatically pulls in the local versions of the files you previously exported. You won’t need to go off to the internet for those files again!

Caveats, Gotcha’s and a bit of tweaking

OK, so the library isn’t always perfect, the automatic download feature sometimes skips stuff (as I mentioned before). For these ones, Kodi may still go off to the internet at some stage, or they may be missed off altogether. That’s OK, we can fix that!

Movies that aren’t detected

You can easily see which files were not detected, because when you open your movies folder in your favourite file manager you will see which ones do not have any .nfo .tbn files etc beside them. (To do this make sure you’re viewing your files sorted by name). It’s these one’s that you need to do a bit of manual tweaking, but once you’ve done it, you shouldn’t need to go back to them, and they should stay there accross new versions of Kodi.

The way Kodi uses it’s scrapers is based on a file filter using something called regex. Don’t worry about that too much, but just understand that the name of each of your files is quite important so that Kodi knows what movie to look up. As an example, if you have a movie with a ‘ in it’s name, it needs to go into the file. For example, if you had the Movie, “My Moms New Boyfriend”, it needs to read, “My Mom’s New Boyfriend”. This is because if you look it up on the internet (the same thing the Kodi scraper does) it is actually written on the internet this way and the apostrophe is counted as a character it needs to match. After you’ve changed the name of your movie, right click or press C on any movie in the library and choose, “Update Library”. It’ll most likely turn up.

If a movie is still not being detected, plug it into google and see what comes up. If you can find it in imdb.com and it has the same name, there’s another trick you can do.

Copy the url from imdb.com (or another supported scraper site (which you can get a list of from that same settings screen we went to above) and paste it as the only line in a text file. Put the text file beside the movie in question and call it EXACTLY the same name but with .nfo on the end (so it should look like shrek.nfo for example). Then choose update libarary again. Kodi should say, “Oh, for this movie I need to go and look at this web address”. If it does find something and it works well, you should re-export your library exactly the same as we did before (above) and choose yes to overwrite your files. Then you will never have to go back to this particular one again.

If it doesn’t work, keep looking for web sites. If you still can’t get the scraper to work you can put it in manually. Most of the time these ones will not have fanart, but you should still be able to get a DVD cover and info on the movie.

The first step is to download a DVD cover off the internet. Just google for it, get the enlarged version if available and right click, save as and put it somewhere on your computer. You then need to convert the file to a .tbn file. To do this in linux you need imagemagick installed (also available for windows I believe). Once installed, type, “convert yourcovername.jpg yourcovername.tbn. Then copy that file beside the movie file in question and give it the same name but keeping the .tbn extension. If you update your library you should see the dvd cover display appear. Occasionally, I’ve had to remove and re-add the Video source to get this to work, but it’s no big deal since it doesn’t have to go off to the internet any more. 🙂

For the information that goes with the movie, copy one of the other movies .nfo files and edit it. It’s pretty obvious what you need to change, just make sure it’s named yourmove.nfo, not the old movie name as you’ll stuff things up and need to remove and re-add your library again.

Welcome to your new Kodi library that installs in minutes instead of hours! 🙂 Have fun!