[mythtv-users] This program was previously recorded... but it wasn't!

Michael T. Dean mtdean at thirdcontact.com
Wed Nov 22 21:19:27 UTC 2006

On 11/22/2006 04:06 PM, Jeff Simpson wrote:
>> But, dropping the database and then importing the entire backup would
>> mean that you'd have an old schema version in new MySQL 4.1 format
>> (since backups are just SQL, they will go in fine--assuming you're using
>> a "portable" backup--as per
>> http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.5 --rather than just
>> backing up the MySQL data files).  Then, you just need to run
>> mythtv-setup, mythbackend, or mythfrontend and it will upgrade your
>> schema to current (running mythtv-setup first and fixing any settings is
>> the most appropriate).
> That's true. If only i'd realized it sooner, I probably would have
> done that. It's been a couple weeks since the MySQL upgrade, so a good
> portion of the recordings have happened since then. The problem is, it
> all seemed to be working fine, so I just kept on trucking and only
> recently realized the database corruption. I do have a backup I can
> try to re-import pieces of (I'll need to hack around the .sql file to
> make it only import data and not table structure)
>> If you have a database backup from before the corruption, there's no
>> need to lose everything.  A databse backup is the pillow between you and
>> that rock/hard place.  :)
> I think I'll start by getting it up and working again, then maybe I'll
> re-import the old recordings. I think I'll probably import them into a
> different database, then export only the ones I want to use to a .sql
> file (then reimport those again into the right db). It's a bit of a
> pain, but for the most part, I just want new recordings to work
> properly again.

I highly recommend that after you drop the corrupt database, but before 
you create a new good database, you import the old backup.  Then, run 
mythtv-setup and exit.  That will upgrade the data from the old backup 
to the new schema version.  Then, export the 

Then, go ahead and start from scratch (drop the old-data-new-schema 
database and pretend like it's a new system).  Once you're ready for 
recordings, do as http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7 
with the old-data-in-new-schema backup (but also do "recordedseek"--the 
docs were updated, but are not yet on the website) but look through your 
recorded records and delete anything you don't still have (i.e. what 
you've deleted since the old backup).

> There should be some kind of major warning against willy-nilly
> upgrading MySQL.

I'm pretty sure those warnings are on the MySQL site.  :)

>  I've done it before, and usually it works fine, but
> this upgrade managed to corrupt all my data. Oh well, hopefully this
> thread will help people who search for this problem in the future
> solve it.
> So in summary, the CORRECT way to upgrade MySQL from 4.0 to 4.1:
> - back up all your databases to .sql files
> - drop all the databases
> - update MySQL
> - re-add the databases
> - restore the contents from the .sql files



More information about the mythtv-users mailing list