This guide will show you how to backup the video library using NFO files and local images. These NFO files are little text files that save all the "metadata" (summaries, credits, playcount, and other library data) for each individual video that are then placed along side the actual video files. These act as a backup for each entry, and can also be used as a way of changing library information or for scanning files that are not recognized by a scraper website. This also saves any changes you've made in Kodi, such as changing the title, sort title, selecting specific images/artwork, movie sets, video library tags, watched history, and resume points.
Backing up the video library is a good idea for several reasons: rebuilding your library in case of damage to your main HTPC, mistakenly removed library entries, duplicate the same library on other Kodi installs, or let you to easily move your video files without losing special changes or your watched history. It also allows for off-line library scanning or if a scraper website goes away.
1 Moving the library
The steps in this guide include how to use the backup to move video files to a new location.
When you scan video files into the library, Kodi will remember the exact location of the files used. If you'd like to move the video files, say from a local hard drive to a NAS or changing the file sharing protocol you use, then you will need to update paths stored in Kodi's library. Exporting NFO files will preserve your Kodi library when you move the location of your video files and ensure that all of the "metadata" (summaries, credits, etc) is preserved, along with your watched history and resume points.
|| Backing up|
Export the video library to individual NFO files and local images.
Note: If you've already exported your library (or created NFO files with another program) then you will still need to re-export and tell Kodi to overwrite old files. This will make sure that your watched history, resume points, and any other changes you've made gets saved. However, in that situation you can probably skip re-exporting images.
- In Kodi go to Settings -> Media -> Library and select Export library. Various pop-up windows will show up:
- Say "multiple files" when asked how you would like to export.
- Say "Yes" when asked about exporting thumbnails and fanart.
- Say "Yes" when asked about actor thumbnails. 
- Say "Yes" when asked if you want to overwrite old files.
- Kodi will now export the library, which may take a while depending on your library size and speed of your HTPC and/or network.
If you only wish to backup your library then you don't need to go any further. The rest of the steps will show you how to rebuild your library using the NFO files and local images you just saved.
|| Close Kodi.
If you are moving the library then you can now move those video files to their new location.
|| You'll want to add the import watch and resume tags to an advancedsettings.xml file.
- Create a plain text file (no rich text formatting, don't use .doc, etc) and save it as advancedsettings.xml. Make sure that the file extension is ".xml" and not ".txt" or ".xml.txt".
- Cut and paste this into your new plain text file:
- Save this file in your userdata folder:
| userdata folder location:
- Note: In older versions of the software (before v14) the
kodi directories were named
| Operating system
|| File path
|| Android/data/org.xbmc.kodi/files/.kodi/userdata/ (see note)
|| /Users/<your_user_name>/Library/Application Support/Kodi/userdata/ (see note)
|| Start - type %APPDATA%\kodi\userdata - press <Enter>
| Windows UWP
- If you have an existing advancedsettings.xml file then make sure the tags are between the main
|| Move all of your "MyVideos".db files and your sources.xml file out of userdata/Database/ (see step 5.3 for location) so that Kodi will create a new blank database. Don't delete the files just yet, in case something goes wrong. If you are using MySQL then use the "|
DROP" command from the MySQL command line tool.
|| Open Kodi. If Kodi is already running then restart it so that the changes you've made will take effect.
|| Add the new source in Kodi and set content for your TV shows and movies folders. Note: You will likely want to choose a scraper rather than "local info", so that you can continue to add new files to your library. NFO files and local images will always take precedence over internet data.
|| Scan the library back in. For every NFO file and local image that Kodi finds, that data will be used instead of redownloading it from the internet. This will also restore your watched history and resume points. The NFO files and images are only used at the time of the library scan. If you'd like to use the NFO files to make changes in the future then you will need to refresh that entry to rescan the NFO changes.
|| If everything seems to have gone well, you can now delete the old "MyVideos" database files.
3 What is not backed up
This guide only covers the information stored for the video library. It doesn't include the following, which is covered in Backup:
- Kodi itself and general settings for the GUI, audio/video, hardware, etc.
- Add-ons and their settings
- Passwords are not saved in any NFO file, even if stored on a password protected file server.
4 Why "multiple files" and not single-file export?
You can use a single-file export for backup or library migration, but there are some added complication involving images:
| Click the "Expand" button for details -->
When images are downloaded from the internet during a library scan, Kodi saves those images locally in a cache (the thumbnails folder in the userdata folder). If the images are missing, like they would be on a new Kodi device added to an existing MySQL setup, or if an image became corrupted/missing, then Kodi looks for a URL to download the image again. When importing from the "single file" (which is a single XML file inside a folder with images), the image URL replaces the online URL with a path that points to the exported folder.
So instead of
http://scraperwebsite.com/something/dvdcover.jpg, we get something like
D:\Folder\Exported folder\Images\dvdcover.jpg or whatever file path it was loaded with.
A new Kodi instance would be confused, because it probably doesn't have that folder in the same location, or because the user deleted this folder after importing. You can get around this by doing your import step by using a network source, like an SMB share where the video files are, so the URL works from all the computers. It would make the path something like
smb://server/folder/Exported_folder/images/dvdcover.jpg, and then there would be no issue.
Once the images are cached/saved locally on each Kodi device, the exported image copies are only used if something happens to the local copies (or if a new Kodi instance is added to a MySQL setup).
Alternatively, you could do a single-file export without exporting images, and the image URL shouldn't be touched at all. The big reason for not suggesting that is some people have very old libraries and their image URLs no longer work (the scrapers sometimes change the URLs or delete specific versions of an image, maybe the user changed a DVD cover with an image they made, etc). Because of that we encourage people to use an export/import step that uses the images they already have on their original library, since we can't be certain those images still exist online.
As for why images aren't directly shared across Kodi instances, this is for a few reasons. The biggest is performance/speed. Images are much larger than text movie summaries, so we can normally get away with a central text database, but images make a much more noticeable impact for some libraries. Another reason is that individual Kodi devices can have their own settings for the resolution of the images. For example, the Raspberry Pi will save images at a lower quality/size in order to compensate for the slower CPU, but on more powerful Kodi devices we don't have that issue and we want to show the higher quality versions of the images when we can.
There are additional technical reasons for not sharing the image cache. The basic gist is that Kodi doesn't anticipate sharing images with other Kodi instances and it can cause various errors.
- ↑ Actor thumbnails - You can say say no if you don't really care about pictures for actors. Plus Kodi exports actor thumbnails in a weird way that causes it to take up more drive space than necessary, since it will save actor images per TV show. It's not a lot of space, but still kind of annoying. If you don't export actor thumbnails, then when you later "import"/scan those files Kodi will redownload the images from the internet unless you turn off actor thumbs under Settings -> Videos -> Library.
6 See also