[mythtv-users] Problem upgrading from 0.24 fixes to 0.25 schema 1266 to 1299

Michael T. Dean mtdean at thirdcontact.com
Wed Apr 11 02:14:27 UTC 2012


On 04/10/2012 09:32 PM, david.medland-slater wrote:
> Hi - I think I'm sunk, but in case someone has any thoughts.  I have 
> been using 0.24 mythbuntu for some time and have been running with the 
> latest fixes.  Ages ago I dabbled with 0.25, found issues and restored 
> the DB back.  And I've been fine ever since.
>
> However today when I upgraded to 0.25 the backup wants to upgrade from 
> 1266 to 1299 and fails.  I see the backup taking place and I had done 
> a manual one as well.
>
> (The file referred to below README.database doesn't seem to exist on 
> my system)
>
> As always guidance appreciated.
>
> 2012-04-11 13:06:43.225611 C  mythbackend version: fixes/0.25 [v0.25] 
> www.mythtv.org
> 2012-04-11 13:06:43.225670 N  Enabled verbose msgs:  general
> 2012-04-11 13:06:43.225731 N  Setting Log Level to LOG_INFO
> 2012-04-11 13:06:43.225842 I  Added logging to the console
> 2012-04-11 13:06:43.225855 I  Added database logging to table logging
> 2012-04-11 13:06:43.226017 N  Setting up SIGHUP handler
> 2012-04-11 13:06:43.226275 N  Using runtime prefix = /usr
> 2012-04-11 13:06:43.226309 N  Using configuration directory = 
> /home/dms/.mythtv
> 2012-04-11 13:06:43.226702 I  Assumed character encoding: en_NZ.UTF-8
> 2012-04-11 13:06:43.227839 N  Empty LocalHostName.
> 2012-04-11 13:06:43.227876 I  Using localhost value of mythtv
> 2012-04-11 13:06:43.246474 N  Setting QT default locale to en_NZ
> 2012-04-11 13:06:43.246505 I  Current locale en_NZ
> 2012-04-11 13:06:43.246589 E  No locale defaults file for en_NZ, skipping
> 2012-04-11 13:06:43.251633 I  Current MythTV Schema Version 
> (DBSchemaVer): 1266
> 2012-04-11 13:06:43.251682 C  MythTV database schema is old. Waiting 
> to see if DB is being upgraded.
> 2012-04-11 13:06:44.256197 I  Current MythTV Schema Version 
> (DBSchemaVer): 1266
> 2012-04-11 13:06:45.258608 I  Current MythTV Schema Version 
> (DBSchemaVer): 1266
> 2012-04-11 13:06:46.261075 I  Current MythTV Schema Version 
> (DBSchemaVer): 1266
> 2012-04-11 13:06:47.263486 I  Current MythTV Schema Version 
> (DBSchemaVer): 1266
> 2012-04-11 13:06:48.265951 I  Current MythTV Schema Version 
> (DBSchemaVer): 1266
> 2012-04-11 13:06:48.266053 C  Timed out waiting.
> 2012-04-11 13:06:48.277743 E  Backing up database with script: 
> '/usr/share/mythtv/mythconverg_backup.pl'
> 2012-04-11 13:06:48.278065 I  Starting process manager
> 2012-04-11 13:06:48.278198 I  Starting process signal handler
> 2012-04-11 13:06:48.279573 I  Starting IO manager (read)
> 2012-04-11 13:06:48.279632 I  Starting IO manager (write)
>
> Warning: MythTV wants to upgrade your database,
> for the TV schema, from 1266 to 1299.
>
> Database Host: localhost
> Database Name: mythconverg
>
> If your system becomes unstable, a database backup is located in 
> /var/lib/mythtv/db_backups/mythconverg-1266-20120411130648.sql.gz
>
>
> Shall I upgrade this database? [yes]  2012-04-11 13:06:50.181110 C  
> Database Backup complete.
> 2012-04-11 13:06:50.182098 C  Backed up database to file: 
> '/var/lib/mythtv/db_backups/mythconverg-1266-20120411130648.sql.gz'
>
> 2012-04-11 13:07:40.860267 C  Newest MythTV Schema Version : 1299
> 2012-04-11 13:07:40.868843 E  Unrecognized video database schema 
> version. Unable to upgrade database.
> 2012-04-11 13:07:40.868863 E  Please see 
> mythplugins/mythvideo/README.database for more information.
> 2012-04-11 13:07:40.868874 E  mythvideo.DBSchemaVer: '', 
> VideoDBSchemaVer: '1002', DVDDBSchemaVer: ''
> 2012-04-11 13:07:40.868884 E  Database Schema upgrade FAILED, unlocking.
> 2012-04-11 13:07:40.869055 E  Couldn't upgrade database to new schema

The problem is you once use MythVideo (long, long ago) and then stopped 
using MythVideo, so you have an ancient (unsupported) MythVideo DB 
schema version.

To fix the problem, you need to restore the pre-upgrade backup (the 
0.24-fixes backup at DB schema version 1264) that you made before you 
attempted to upgrade.  If you didn't make one, you will have one in 
/var/lib/mythtv/db_backups/ and it will have a file name like: 
mythconverg-1264-20120411124532.sql.gz .  Do not use the "partially" 
upgrade DB backups (such as 
/var/lib/mythtv/db_backups/mythconverg-1266-20120411130648.sql.gz , 
referenced, above) because they're are in an unknown/potentially broken 
state.

Once you find the right DB backup, do 
http://www.mythtv.org/wiki/Database_Backup_and_Restore#Replacing_an_existing_database 
, so, something like:

mythconverg_restore.pl --drop_database --create_database --filename 
mythconverg-1264-20120411124532.sql.gz

Then, you will need to delete the MythVideo schema.  Note that once you 
upgrade to 0.25, you (or anyone reading this in the archives) can never, 
again, follow the instructions below, since after 0.24, deleting the 
MythVideo schema will destroy your MythTV database.  This is only safe 
to do on a 0.24-fixes or below database schema (the 1264 DB schema 
version I mentioned).  To delete the schema, copy and paste the 
following into a terminal window:

cat << "EOF" | mysql -umythtv -p mythconverg
DROP TABLE IF EXISTS videocast;
DROP TABLE IF EXISTS videocategory;
DROP TABLE IF EXISTS videocountry;
DROP TABLE IF EXISTS videogenre;
DROP TABLE IF EXISTS videometadata;
DROP TABLE IF EXISTS videometadatacast;
DROP TABLE IF EXISTS videometadatacountry;
DROP TABLE IF EXISTS videometadatagenre;
DROP TABLE IF EXISTS videotypes;
DROP TABLE IF EXISTS filemarkup;
DROP TABLE IF EXISTS dvdinput;
DROP TABLE IF EXISTS dvdtranscode;
DELETE FROM settings WHERE value
IN ('mythvideo.DBSchemaVer',
     'VideoDBSchemaVer',
     'DVDDBSchemaVer');
EOF

(and be careful when you copy/paste the above as your client will almost 
definitely add a space after EOF, which will prevent it from working.  I 
recommend copying all the above lines--except the EOF line--then hit 
Enter and type EOF (as in "End Of File"--it's not a zero) and hitting 
Enter, again.

Once that's done, run mythtv-setup or start the master backend to 
upgrade the TV schema, then start mythfrontend and all should work fine.

The most important thing, though is to make sure you find (and protect) 
that 1264 backup.  :)

Mike


More information about the mythtv-users mailing list