[mythtv-users] reverting database schema

Michael T. Dean mtdean at thirdcontact.com
Mon Nov 2 20:34:25 UTC 2009

On 11/02/2009 03:10 PM, Nick Morrott wrote:
> 2009/11/2 Richard Morton:
>> 2009/11/2 Mike McMullin
>>> I've managed to upgrade my back end database to a schema that even it
>>> does not handle (most likely do a prompt when doing an up grade to 9.10
>>> of ubuntu on a remote system).  Is there a simple way of reverting to
>>> the old database schema or should I trash it and redo it all by hand?
>> I take it you haven't got a backup? there is a script to complete sql
>> backups that many people run daily on their backend to prevent such a
>> thing... worth knowing for the future - its in the contrib folder, but you
>> can easily do it from mysql itself or phpmyadmin
> If it's a recent version of MythTV, the schema upgrade process creates
> a pre-upgrade backup of the database (default location is in your
> recordings directory).

Though there are rumors that a certain commonly-used distro uses a 
script which automatically rotates backups and only keeps the one 
most-current (more-specifically, most-recently-created) backup, so 
depending on what happened, the pre-upgrade backup may have been 
overwritten by a post- or intra-upgrade backup.

And, even the backup script distributed with Myth defaults to keeping 
only the last 5 backups, so on a failed upgrade with some 
upstart/monit/... loop continually restarting the backend--which will 
then attempt to upgrade, which will create a new backup, then the 
upgrade will again fail, then mythbackend will shut down, then something 
restarts it--you could easily loose your automatic backup.

Always manually backup before upgrade in case someone "helps" you manage 
your backups.

I wrote the automatic backup code, and I don't have anything 
automatically starting/restarting programs, and I still always 
"manually" backup my database before any upgrade.  :)

This info is, obviously, for anyone else reading the thread--those for 
whom it may not be too late.  :)



More information about the mythtv-users mailing list