MySQL/Upgrading

From Official Kodi Wiki
Jump to navigation Jump to search

HOW-TO:Sync multiple libraries/Contents When updating to a new version, XBMC will make a copy of the current DB and upgrade the copy. That way if anything goes wrong in the upgrading you still have an original untouched copy of your DB.


Starting in XBMC v12 "Frodo", you no longer need to use path substitution to sync thumbnails and other art between XBMC devices.


Updating your library may take a few minutes, so be sure to give XBMC time to do its thing. Stopping midway will mess up the updated DB.


Backing up the database

BACKUP YOUR DATABASE JUST IN CASE.

Even though XBMC makes a copy of your DB and updates that, it is still highly recommended to export your library from your current version before beginning the upgrade process. You don't want to find yourself starting your library from scratch, and it's better to be safe than sorry.

It's also a good idea to make periodic backups of your library even if you are not updating XBMC. Disks can fail, bugs can happen, and if you've put a lot of time in setting up your library then you should play it safe.

Making sure MySQL can update the library

Note: If you originally set up MySQL using this XBMC Wiki guide then you do not have to worry about this section.

For XBMC to update the library from a previous version, you may need to make changes to your MySQL server. The user made for the MySQL DB ("xbmc" in most guides) will need access to create new databases. If the user already has that access then you don't need to do anything. If not, you will have to use the following command on your MySQL server:

  • GRANT ALL ON *.* TO 'xbmc';

Thumbnails

If you used Path Substitution

As noted at the top of this page, XBMC v12 no longer uses path substitution for syncing thumbnails.

If you used path subs for the entire Thumbnails folder - Extra safe method[1]
  1. Quit all XBMC devices.
  2. Update all instances to XBMC v12 "Frodo", but don't open/launch XBMC yet.
  3. Choose one XBMC device and open XBMC
  4. Say yes when it asks to update art.
  5. Copy your path-substituted thumbnails folder onto all XBMC devices, replacing the local thumbnails folder in the userdata folder.
  6. On the first XBMC device go into userdata/database/ and copy the "Textures13.db" file to all the other XBMC devices in their userdata/database/ folders.
  7. Remove path substitution for thumbnails from the advancedsettings.xml file of each XBMC device.
  8. You can now open/launch XBMC on your other devices.
  9. From that point on, XBMC will sync art/thumbs directly to each XBMC box, but will keep them in sync (whereas before XBMC would only add art on one box, and boxes could have different artwork if set manually). Having the thumbnails folder locally on each box will also speed up loading the library, and what art to use is stored in the videos DB that MySQL is already sharing.


If you used path subs for only userdata/thumbnails/videos/ and userdata/thumbnails/music/ - Extra safe method[1]
  1. Quit all XBMC devices.
  2. Choose one XBMC device to do the initial thumbnails update.
  3. Copy the path-substituted thumbnails folder(s) for userdata/thumbnails/videos/ and/or userdata/thumbnails/music/ to the local userdata/thumbnails/ folder on your first XBMC device.
    If your thumbnails folders are being shared from another XBMC device's thumbnails folder then you don't need to do this. Just make that XBMC device your "first device" for these instructions.
  4. Update all instances to XBMC v12 "Frodo", but don't open/launch XBMC yet.
  5. Open XBMC on your first device.
  6. Say yes when it asks to update art.
  7. Copy your the thumbnails folder from the first XBMC device onto all the other XBMC devices.
  8. On the first XBMC device go into userdata/database/ and copy the "Textures13.db" file to all the other XBMC devices in their userdata/database/ folders.
  9. Remove path substitution for thumbnails from the advancedsettings.xml file of each XBMC device.
  10. You can now open/launch XBMC on your other devices.
  11. From that point on, XBMC will sync art/thumbs directly to each XBMC box, but will keep them in sync (whereas before XBMC would only add art on one box, and boxes could have different artwork if set manually). Having the thumbnails folder locally on each box will also speed up loading the library, and what art to use is stored in the videos DB that MySQL is already sharing.


If you copied your thumbnails folder

If you simply copied your thumbnails folder between XBMC devices then you technically don't have to do anything extra. However, you may wish to use this extra safe method:[1]

  1. Quit all XBMC devices.
  2. Update all instances to XBMC v12 "Frodo", but don't open/launch XBMC yet.
  3. Choose one XBMC device and open XBMC
  4. Say yes when it asks to update art.
  5. Copy your the thumbnails folder from the first XBMC device onto all the other XBMC devices.
  6. On the first XBMC device go into userdata/database/ and copy the "Textures13.db" file to all the other XBMC devices in their userdata/database/ folders.
  7. You can now open/launch XBMC on your other devices.

If you used some process to keep the individual thumbnail folders in sync (such as a script, Dropbox, symbolic links, or rsync) then you no longer need to use those processes. XBMC will download images for new library entries on each XBMC device, and will synchronize the download URL via MySQL (using the videos and/or music DB).

Common problems

Name tag

If your upgrade fails with database errors, you should edit your advancedsettings.xml and remove the lines <name>myvideos</name> and <name>mymusic</name>. They are only needed if you want to use multiple Video or Audio MySQL databases.

Notes

  1. 1.0 1.1 1.2 The extra safe part is because we copy the thumbnails artwork manually to each XBMC device, instead of having XBMC just download the art from the internet. If you have library items that scanned their art in a long time ago then the internet copy might not exist anymore, hence this extra safe method.