September update lost all my media data

I’ve just upgraded my Pi with the September update. It applied cleanly enough and the Pi restarted but no media was showing. I used to have a lot of movies and music on NFS shares with the database on a MySQL server.

After the update, all the files are still on the NFS share but the DB is empty.

After investigation, it seems that this moved to a new DB schema and no data was migrated. I’ve re-entered my NFS paths and re-scanned the library, but now all the play counts, etc. are initialised.

I’m assuming that the schema upgrade was expected… but I would have expected the old data to be migrated… which clearly hasn’t happened. Should it have happened?

I’m using the library auto-updater, so could this have interfered with the upgrade in some way?

If there was supposed to be a data migration to the new schema, is there a way to trigger this manually so that I can recover the old data?

Thanks in advance…

When Kodi does a major version update (i.e. from 16.x to 17.x) the database schema usually changes, but will be updated as part of the upgrade. With that in mind, it must have been quite a long time since you did your last update.

When the database is updated, the original database is not removed, so if for some reason the database did not get updated you can remove the newly created database, and stop/start Kodi. It will then try to upgrade the database again. This can take a while depending on the size of your database.


I did a clean install of OSMC about a week ago because the SD card died. I used the Linux installer and downloaded a fresh image. All I then did was restore the advancedsettings.xml, guisettings.xml and keymaps/remote.xml config files from an older backup and reboot the Pi. It ran perfectly and all media was there on the UI.

So, effectively, I would have expected the last update to be just 1 week ago.

I’ll try disabling the library auto-update plugin, stopping kodi, deleting the new DBs then restarting Kodi. Hopefully that will trigger the DB migration…

If you did a fresh install a week ago, then something else happened.

Verify your advancedsettings.xml, maybe it was pointed to an old version of the database.

Nope. I only have one DB server that the Pi can see so it couldn’t have pointed elsewhere.

I’ve just done the above steps and it has migrated cleanly.

My suspicion, although I can’t prove it (yet) is that the library auto-updater ran when Kodi started… and this interfered with the library upgrade.

With the library auto-updater disabled, Kodi has cleanly migrated the data to the new schema after the restart.

Thanks for your suggestion to clear the DB and restart - that’s fixed it (with the library auto-update disabled).