Kodi 21 database migration incomplete
#1
Until two days ago, I used Kodi 20 with MariaDB 10.3.2 from my Nvidia Shield device without problems. After the update to Kodi 21, MyVideos121 migrated to MyVideos131 and Kodi started scanning. All movies and tvshows are found and can be accessed, but no information is stored. After scanning, the content references on the folders are lost as well.

I have a feeling the migration didn't go well. When inspecting the database, I noticed that MyVideos121 has views besides tables, but MyVideos131 only has tables but no views. I removed the databases to migrate again, but the resulting database is the same. I'm unable to find an "upgrade" log which could provide information on any migration issues.

Just to be certain, I removed advancedsettings.xml to confirm that Kodi can still create a database with information. Just not a MySQL database.

I have the kodi.log at https://paste.kodi.tv/sogikemaka.kodi
The line `2024-04-26 20:54:57.143 T:22366 error <general>: SQL: Can't determine list of routines to drop.` is suspicious to me...

Did anyone else have this issue?
Is there an upgrade log available somewhere?
Reply
#2
Had the same problem. Check my post here
Reply
#3
can you please to run mysql_upgrade before the migration attempt?
Code:

/ # mysql_upgrade
This installation of MariaDB is already upgraded to 10.11.4-MariaDB.
There is no need to run mysql_upgrade again for 10.11.6-MariaDB.
You can use --force if you still want to run mysql_upgrade
/ #

i just had a succesful migration from MyVideos121 (Nexus) to MyVideos131 (Omega) on 10.11.6-MariaDB Alpine Linux
Reply
#4
I was unable to resolve the problems and had to fix things with a workaround solution.

I ended up exporting the information to NFO files with a downgraded Kodi 20, deleting all databases, and creating and filling a new database when upgrading to Kodi 21. Not how it is supposed to go, and the first serious issue in 15 years.

Edit:
It appears the same workaround as mentioned in https://forum.kodi.tv/showthread.php?tid=377267
I seem something might be broken with the upgrade script
Reply
#5
(2024-04-28, 11:28)Zwerver Wrote: I was unable to resolve the problems and had to fix things with a workaround solution.
hm, workaround is no good. :-(

Did you have issues - for whatever reason - in running the mysql_upgrade or did a successful run of mysql_upgrade not resolve the migration of Kodi databases?
Reply
#6
@Zwerver can you run manually the query that seems to be causing a problem in the migration, using the Kodi user account ('xbmc' for you it seems).

SELECT * FROM information_schema.routines
WHERE routine_type = 'FUNCTION' and routine_schema = 'MyVideos121';

Run also for the upgraded not-working MyVideos131 and the music databases MyMusic82 and MyMusic83.

Please double-check the permissions granted to the Kodi user.

Migration attempted here with 11.2.2 and 11.3.2, with and without running mariadb-upgrade first or not, all worked.
I'm using mariadb docker containers, they work well and are quite convenient to test many versions.

Running mysql_upgrade (now named mariadb-upgrade in more recent versions) is a good suggestion.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#7
Some extra information regarding the questions.

I mentioned the wrong database version. I'm currently running 11.3.2-MariaDB from docker (mariadb:latest). To examine the problem, I've downgraded to the previous version as well, but without any difference in results. As I mentioned, I ended up deleting the databases to fix my problem, so I'm unable to reproduce the problem anymore. Sorry. The permissions in the database were the first thing I checked. No issues there. To be sure, I (re)granted the permissions again. No differences. Also, the database was created succesfully, including all tables. But no views. I did try to find any log on my Nvidia Shield regarding any upgrade script, but was unable to find any.

Reading your comments, I've looked into mysql_upgrade and this might be the culprit.

I assumed that a docker upgrade also triggers the update of the databases, but when I read https://hub.docker.com/_/mariadb it appears that an environment variable can be used to automate and activate that. I haven't set this, so the database might have become outdated in some regards. The original database is created around 2014 and was used as source for any new databases in the relevant Kodi upgrades ever since (Ubuntu server until 2022, then NVidia Shield). So to be sure not sure, I run the query against the NEW database:

sql:
SELECT * FROM information_schema.routines WHERE routine_type = 'FUNCTION' and routine_schema = 'MyVideos131';

and there was a problem

sql:
#1728 - Cannot load from mysql.proc. The table is probably corrupted

I set environemt variable MARIADB_AUTO_UPGRADE=1 and restarted the docker. After that, the query was resolved correctly with empty results. Kodi still appears to work correctly. I'm not sure if this is the expected result?
Reply
#8
Good. mariadb-upgrade needs to run once per mariadb version upgrade but it doesn't hurt in common situations to run it more often.

The migration should work afterwards, unless you hit another problem (likely duplicated entries in the movie table for same idFile, a debug log of the migration would tell us)
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi 21 database migration incomplete0