Recently while the wife & kids were at the in-laws for the holidays, I took the time to upgrade my R4V4 box to the latest (R5A26).
I was really impressed with the installer, but unfortunately after everything was done my box would always just boot to the desktop. Mythtv wouldn't even start when I tried to launch it from the application menu.
I looked in /var/log/mythtv/backend.log and gathered from the messages that it failed while trying to update my db schema to the current version. The SQL command to update the programgenres table was failing because a column that the new schema wanted to be unique was not unique. Searching the mythtv-users list pointed me at the the source code to the file dbcheck.cpp.
I went into mysql and deleted the duplicate entries - they were all for very old shows anyway. I then did the rest of the schema changes for that version (1051) by hand. I just copied the sql from dbcheck.cpp. I also had to update the schema version in the settings table.
This seemed to solve the problem. Myth then started up fine and I was very proud of myself for figuring out the solution without posting here. Unfortunately as I looked around there were a number of new problems that I couldn't solve. I could see my old recorded programs in "Watch Recordings" but I couldn't watch them. When I went to watch live tv, it said all my tuners were busy. Scheduling shows didn't work either. I don't remember the error but it was similar to no tuner available. I tried re-running mythtv-setup, but it seemed like myth tv setup couldn't see my tuner card. It just seemed like there were too many changes between R4V4 and R5A26. I was ready to give up and try a clean install, but I had some recorded programs stiill on the /myth partition that I would have prefered not to loose.
I know there is the rebuild-database script to rebuild the database from the files on the disk, but that essentially means retyping in the info for all my shows. I knew that I had all the info for these shows in the mysql dump from the backup.
So here's how I worked around it... I made a copy of everything in /myth/backup over the network to my desktop system. Then I cleared out everything in /myth/backup. I rebooted with the knoppmyth install disk and did another automatic upgrade. I then pulled out the sql for the recorded table from the mythconverge.sql dump into a different file (record.sql). The sql lines from the my old db were in the old schema, and need to be converted to the new schema. The old lines looked like this:
Code:
INSERT INTO recorded VALUES (1009,20051225233000,20051226000200,'Fawlty Towers','Communications Problems','Basil deals with a demanding but deaf guest.','Sitcom','Pandora',NULL,0,NULL,1,0,'Default',325,'SH001588','EP0015880010');
A little crafty search and replace in my favorite text editor changed them into something like this:
Code:
INSERT INTO recorded (chanid, starttime, endtime, title, subtitle, description, category, hostname, bookmark, editing, cutlist, autoexpire, commflagged, recgroup, recordid, seriesid, programid) VALUES (1009,20051225233000,20051226000200,'Fawlty Towers','Communications Problems','Basil deals with a demanding but deaf guest.','Sitcom','Pandora',NULL,0,NULL,1,0,'Default',325,'SH001588','EP0015880010');
I shut down mythbackend and executed the new sql file with the my new (empty) db then restarted. This restored all my old shows and everything was working fine. I could have done a similar thing to restore my recording schedule too, but I decided to just re-enter the schedules by hand. I didn't have that many re-curring recordings.
I just wanted to tell my tale in case this is useful to someone else in the future. Hope this helps someone...