Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magnetikonline/dd18a6bd357542b1421d to your computer and use it in GitHub Desktop.
Save magnetikonline/dd18a6bd357542b1421d to your computer and use it in GitHub Desktop.
XBMC update library paths.

XBMC update library paths

Taken from XBMC Wiki.

Video library

SQL

UPDATE art SET url = REPLACE(url,'nfs://192.168.0.2/','nfs://nas/');
UPDATE episode SET c18 = REPLACE(c18,'nfs://192.168.0.2/','nfs://nas/');
UPDATE movie SET c22 = REPLACE(c22,'nfs://192.168.0.2/','nfs://nas/');
UPDATE path SET strPath = REPLACE(strPath,'nfs://192.168.0.2/','nfs://nas/');
UPDATE tvshow SET c16 = REPLACE(c16,'nfs://192.168.0.2/','nfs://nas/');

Example

$ sudo apt-get install sqlite3
$ cd ~/.xbmc/userdata/Database
# find newest MyVideos*.db
$ ls -1 MyVideos*.db | sort -r | head -n1
$ sqlite3 [VIDEO_DB_FILE] < commands.sql

Finally, update ~/.xbmc/userdata/sources.xml to match.

Music library

SQL

UPDATE path SET strPath = REPLACE(strPath,'nfs://192.168.0.2/','nfs://nas/');

Example

$ sudo apt-get install sqlite3
$ cd ~/.xbmc/userdata/Database
# find newest MyMusic*.db
$ ls -1 MyMusic*.db | sort -r | head -n1
$ sqlite3 [MUSIC_DB_FILE] < commands.sql

Finally, update ~/.xbmc/userdata/sources.xml to match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment