HOW-TO:Backup the video library

From Official Kodi Wiki
Jump to: navigation, search
Home icon grey.png   ▶ Video library
▶ Backup
▶ HOW-TO:Backup the video library

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.

Contents

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.

2 Steps

1 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.

  1. In Kodi go to Settings -> Videos -> Library and select Export library. Various pop-up windows will show up:
  2. Say "multiple files" when asked how you would like to export.
  3. Say "Yes" when asked about exporting thumbnails and fanart.
  4. Say "Yes" when asked about actor thumbnails. [1]
  5. Say "Yes" when asked if you want to overwrite old files.
  6. Kodi will now export the library, which may take a while depending on your library size and speed of your HTPC and/or network.
2 Restoring
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.
3 Close Kodi.
4 Optional
If you are moving the library then you can now move those video files to their new location.
5 You'll want to add the import watch and resume tags to an advancedsettings.xml file.
  1. 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".
  2. Cut and paste this into your new plain text file:
    <advancedsettings>
      <videolibrary>
        <importwatchedstate>true</importwatchedstate>
        <importresumepoint>true</importresumepoint>
      </videolibrary>
    </advancedsettings>
  3. Save this file in your userdata folder:
If you have an existing advancedsettings.xml file then make sure the tags are between the main <advancedsettings></advancedsettings> tags.
6 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.
7 Open Kodi. If Kodi is already running then restart it so that the changes you've made will take effect.
8 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.
9 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.
10 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.
  • Playlists
  • 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:

5 Notes

  1. 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

Personal tools
Namespaces

Variants
Actions
Navigation
Wiki help
Toolbox