[mythtv-users] WARNING: 0.21-fixes to trunk DB upgrade takes a long time (was: Re: Database not upgrading in trunk)

Michael T. Dean mtdean at thirdcontact.com
Mon Sep 7 19:35:06 UTC 2009


On 09/07/2009 03:10 PM, Steve Reilly wrote:
> nik gibson wrote:
>   
>> Normally when I upgrade to a new myth version the database
>> automatically upgrades when the backend starts but after my last
>> couple upgrades the frontend complains about an old db version and no
>> upgrade occurs.
>>
>> Is there anyway to force a database schema upgrade?  I've had a couple
>> backend crashes in the last couple weeks and I wondering if it's due
>> to the database schema being old as the frontend states.  I'm running
>> the most recent mythbuntu weekly build of trunk.
>>
>> This is from the mythfrontend log:
>>
>> 009-09-07 13:19:13.290 Current Schema Version: 1244
>> 2009-09-07 13:19:13.350 Registering Internal as a media playback plugin.
>> 2009-09-07 13:19:13.395 MonitorRegisterExtensions(0x100, gif,jpg,png)
>> 2009-09-07 13:19:13.601 Current Schema Version: 1016
>> 2009-09-07 13:19:13.601 Database schema is old. Waiting to see if DB
>> is being upgraded.
>> 2009-09-07 13:19:14.673 Current Schema Version: 1016
>> 2009-09-07 13:19:15.676 Current Schema Version: 1016
>> 2009-09-07 13:19:16.680 Current Schema Version: 1016
>> 2009-09-07 13:19:16.680 Timed out waiting.
>>     

This is /not/ an error.  It is simply saying that it does not seem that 
some other process is upgrading the schema since the schema remained the 
same over all the checks.  Therefore, the current process decides to 
perform the upgrade for you.***

The fact that it shows the DB schema version of your database as 
1216--which was /never/ usable with any version of MythTV--indicates 
that this log is not showing the /first/ upgrade attempt from -fixes to 
trunk.  Therefore, I'm guessing someone/something stopped the upgrade 
and you restarted.

> i upgraded trunk a couple days ago and same as you running mythbuntu
> weekly builds.  got a pop up saying old database, "upgrade?"  bottom of
> screen had to move choice to yes, then it asked again same question if i
> remember correctly. checking logs, looks like im at schema 1017 now..
> after that had no problems.  is that what happened to you?

If someone can't get me the actual (first) failure error logs, I won't 
be able to fix this.

I /seriously/ believe that people are getting impatient when they 
attempt the upgrade the first time and kill mythbackend or mythtv-setup 
mid-upgrade.

NOTE: The upgrade from 0.21-fixes to trunk takes a /long/ time.  If you 
kill the process that's doing the upgrade, you will almost certainly 
corrupt some or all of your MythTV data.  Please ensure you give it 
sufficient time for the upgrade to complete--potentially 10's of minutes.

If you did not do so--you killed the process before it had time to 
finish the upgrade--please revert to the backed up version of your 
0.21-fixes database (Myth attempts to create a backup before performing 
the upgrade--it will be in a directory in your DB Backups storage group 
or, if you don't have a DB Backups storage group, a directory in your 
Default storage group--on the system that performs the database 
upgrade).****  After restoring the 0.21-fixes backup ( 
http://www.mythtv.org/wiki/Database_Backup_and_Restore#Database_Restore 
), then let MythTV upgrade and this time do /not/ kill the process.

If you don't take the time to do this now, you'll likely find problems 
down the line that may result in your loss of a lot of mythtv historical 
data (or, at the very least, result in your wasting time having to clear 
all re-creatable data and reconfiguring /all/ of MythTV from scratch).

Mike

***Yes, it is possible for this, "Is someone else upgrading the 
database," check to fail--especially due to the large/slow updates that 
occur between 0.21-fixes and trunk.  Therefore, I /highly/ recommend 
starting mythtv-setup manually after installing trunk and /before/ ever 
starting mythbackend or any other mythtv application.  If your distro 
automatically starts things, ensure you do not upgrade/restart any 
systems until your master backend is upgraded/restarted /and/ the 
database upgrade succeeds.

****I (the guy who wrote the code that automatically backs up the 
database before upgrade) /strongly/ suggest you manually back up the 
database before upgrading, even though if all goes well, Myth will do it 
for you--we do /not/ stop the upgrade if the backup fails.


More information about the mythtv-users mailing list