Import-export library/Music

From Official Kodi Wiki
Jump to navigation Jump to search
Import-Export Contents
Home icon grey.png   ▶ Music Library ▶ Import Export Library ▶ Music


Introduction

The main data in the music library comes from metadata embedded in the music files, and the export facility does not export this data at all. Likewise import will not populate an empty library as it requires scanning the music file tags into the library first. What is imported and exported is any additional artist and album information that has been previously scraped from NFO files or online sources.

The Import-Export function has been overhauled for v18 and adds more functionality and integrates the new Artist information folder.

Song history and ratings are exported when using the Single File method in v18.2 and later. advancedsettings.xml entries are not required.


Artist Information Folder

In v18 the concept of the Artist Information Folder is introduced as a new way to handle providing local artist artwork and information via nfo files. The Artist Information Folder is a user nominated folder that Kodi will look in first for artwork or NFO files for any artist.

This topic is of interest to those users that want to provide local artwork for artists, or capture their current artist art and additional data for transfer to another installation of Kodi

From v18 the Artist Information Folder can be used to resolve many issues with providing local art and additional information for Artists. Local artist art and nfo files can be provided without requiring a specific folder for music files, and artist NFO files can be kept separately from the music rather than jumbled with it.


Export

The Export and Import Library options are accessed via the Settings menu as detailed in the first image above.

The Export Library function has a number of options as depicted in the second image above. Each one is explained below.

If you intend to export artwork from cache, be aware of the modifications that Kodi makes to cached artwork. If you have local artwork, do not export artwork.

See: Artwork Cache


Single File

Summary:

  • Exports a single .xml file saved to a destination folder specified by the user.
  • Each export is a full export. There are no incremental exports.
  • The only method to export user rating, play counts, last played and scraped ratings and votes. Requires v18.2 or later [1]
  • No artwork is exported.
  • Each file is named kodi_musicdbyyyymmdd_hhmmss. The date is appended to all export files, and the time is only appended to subsequent exports on the same day. [2]


Using:

Destination folder
Enter the location where Kodi will save the single xml file.
Items to export
Select what type of information to be exported
Albums
Additional data for albums
Songs
Will export song rating and history information. Requires v18.2 or later [1]. This includes:
  • User rating
  • Scraped rating and votes
  • Last played and play count
Album artists
Will export the artist that released the album, but will not include guest or collaboration artists on the album
Song artists
Will export the guest or collaboration artists that appear on an album
Other artists
Will create folders for the remaining artists that do not fall into Album or Song artist category. This may include those artists (individual people or groups of individuals) with a specific role but not credited with being album or song artists. For example musicians, orchestra, choir, producer, lyricist, composer, DJ mixer, engineer etc.


To library folders

Note: This option requires the Artist information folder to be set.

See: Artist Information Folder Setting


Summary

  • Artists will be exported to the Artist Information Folder.
  • Additional Album metadata will be exported to the album folder containing the song files.
  • Disambiguation of Artists is by appending the first 4 digits of the <musicBrainzArtistID> to the folder name.
  • Disambiguation of Albums is by appending the first 4 digits of the <musicbrainzalbumid> to the folder name. [3]


Using:

Items to export
Select what type of information to be exported
Albums
Additional data for albums
Album artists
Will export the artist that released the album, but will not include guest or collaboration artists on the album
Song artists
Will export the guest or collaboration artists that appear on an album
Other artists
Will create folders for the remaining artists that do not fall into Album or Song artist category. This may include those artists (individual people or groups of individuals) with a specific role but not credited with being album or song artists. For example musicians, orchestra, choir, producer, lyricist, composer, DJ mixer, engineer etc.
Output information to NFO files
When enabled the export will create NFO files containing the metadata
Include art works such as thumbnails and fanart
When enabled this also exports all the artwork associated with the exported artists and or albums as separate image files
Note that Kodi exports the images from cache in the resolution that it uses them, and this may be lower than the original images. If you have original local artwork in higher resolutions take great care with this export option. It will overwrite these higher images if you tell it to do so and they will be lost
See: Library Artwork in advancedsettings.xml
Overwrite existing files
Affects the previous two settings
When disabled, no NFO files (and artwork if enabled) will be exported for albums and artists that already have them. Only those Albums and Artists that do not have them will recieve the export.
When enabled, all existing NFO files (and artwork if enabled) will be overwritten.


Note: When the last three settings are all disabled, the export becomes the Artist folders only type export


Separate Files for each item


Summary

  • A diagnostic export that can be used to check the status of your library without interfering with your live folders and files
  • Will not export to your existing Artist Information Folder and music sources
  • Exports to a user nominated destination
  • Kodi does not use this export in any way. It can be deleted once you have no further use for it

It will export the selected items to the user nominated Destination folder as follows:

  • Artist folder name is derived from artist name as scanned into the library
  • For each Artist, a folder will be created containing the NFO File and Artwork, if these options were enabled.
  • Album Artists will contain sub-folders for each album. The album NFO file is exported to these album sub-folders.
  • The album folder name is taken from the music folder containing the music files if there is a unique one, otherwise from the album name.
  • Collaboration albums (more than 1 album artist) are placed under the first album artist.
  • Disambiguation of Artists is by appending the first 4 digits of the <musicBrainzArtistID> to the folder name.
  • Disambiguation of Albums is by appending the first 4 digits of the <musicbrainzalbumid> to the folder name. [3]


Using:

Destination folder
Enter the location where Kodi will save the export to.
Items to export
Select what type of information to be exported
Albums
Additional data for albums
Album artists
Will export the artist that released the album, but will not include guest or collaboration artists on the album
Song artists
Will export the guest or collaboration artists that appear on an album
Other artists
Will create folders for the remaining artists that do not fall into Album or Song artist category. This may include those artists (individual people or groups of individuals) with a specific role but not credited with being album or song artists. For example musicians, orchestra, choir, producer, lyricist, composer, DJ mixer, engineer etc.
Output information to NFO files
When enabled the export will create NFO files containing the metadata
Include items that have not been scraped (to create template NFO files)
If an artist or album has not been scraped from online or other sources, then there is no information available to export.
Enabling this setting will force an export by creating a blank template style NFO file. This template can be used to easily add information to be refreshed into the library.
Include art works such as thumbnails and fanart
When enabled, will export all cached artwork
Overwrite existing files
Affects the previous two settings
When disabled, no NFO files (and artwork if enabled) will be exported for albums and artists that already have them. Only those Albums and Artists that do not have them will recieve the export.
When enabled, all existing NFO files (and artwork if enabled) will be overwritten.


Artist folders only


Summary


Using:

Items to export
Select which artists will have folders created
Album artists
Will create a folder for the artist that released the album.
Song artists
Will create a folder for guest or collaboration artists that appear on an album
Other artists
Will create folders for the remaining artists that do not fall into Album or Song artist category. This may include those artists (individual people or groups of individuals) with a specific role but not credited with being album or song artists. For example musicians, orchestra, choir, producer, lyricist, composer, DJ mixer, engineer etc.


Import - Single File

If you exported your library using the Single File method, use the Music Library Import option to import the data

  • Select Import from the settings page
  • Navigate to the folder where you previously saved the single file export
  • Select the appropriate kodi_musicdbyyyymmdd_hhmmss file
  • Select OK and the import process will commence
  • Once complete, your library should be functional again

Be aware:

  • if you have removed Albums or Artists since the export, the metadata for those Albums and Album Artists will be re-imported. To remove the unwanted entries, run the Clean Library option as shown in the above image.



References



Return to top