Extract watched movies from userdata backup

Introduction and context (skip this one if you just want to read my question):
I had an old Alpha version of OSMC installed on my Raspberry Pi, since this was a very old one, I decided to make the upgrade. Yesterday I mad a backup of the userdata (with the OSMC Backup solution and with an add-on xbmcbackup) and installed the newest OSMC from scratch.
After importing the Backup, only the add-ons seems to work, everything else seems to be broken (connection to my NAS, watched movies, configurations, …). I don’t mind starting from the beginning again, might be also the better solution.
The most important thing I wanted to backup are the “watched movies” (and TV series), since I always hide them on Kodi. Once every while I move those movies from the shared folder on my NAS to a not shared one, so when I need more space on the NAS I just delete what is watched. That’s why it would be nice to just know which movies are watched so that I can move them.

Now to the question:
Is there a way to make a list (SQL, text, excel, …) of all my watched movies from a backup’ed userdata folder?

I found a way, here the steps if someone has the same question in the future:

Download SQLite Manager Add-on for Firefox:

Open the DB File of Kodi with the SQLite Add-on:
Open the Database file from \userdata\Database\MyVideosXX.db

SQL Command:
In the Execute SQL Tab paste this SQL command, this will show you all the movies with a Play Cound of greater than 0:
select movie.c00, files.playCount from movie join files on files.idFile=movie.idFile where files.playCount > 0

To just move the movies, just select the path of the watched movies and then use this for example in robocopy or other tool for moving files:
select movie.c22 from movie join files on files.idFile=movie.idFile where files.playCount > 0

I think Milhouse’s texturecache.py can also do this.

Sam

I second using texturecache to backup and restore watched status.

When I migrated from a normal to mysql install I tried two or three different approaches - including Kodi’s built in export/import function which did not work very well to be honest.

In the end I used texturecache to back up watched status, switched to mysql, did a full media scrape again and then used texturecache to restore watched status into the newly scraped library.