[mythtv-users] Clean 0.15 install, what should I save from the old DB?

Bruce Markey bjm at lvcm.com
Thu May 27 18:08:04 EDT 2004

Stephen wrote:
> I bought some new hardware to install mythtv 0.15 and thought I would
> start with a new database.  I would like to carry over some of the old 
> db data, like previously recorded titles and my recording schedule, and 
> anything else that is important/can't be recreated.  What db tables do I 

Make a backup of your database right now:


Look in your file as see that it is thousands of lines of readable
text. Once you know up have a good current backup, then continue.

After you have and good backup, read the rest of this message and
decided you want to do this, go on to:




When you first run setup, mythbackend or mythfrontend, all the
tables will be created for your new database. Therefore, you don't
need any of the CREATE TABLE statement but only need the INSERT
INTO statements for the tables you need to restore.

Restore the information from "record' (the titles you've chosen
to record), 'recorded' (the descriptive info for your recording),
'oldrecorded' (for finding duplicates that you've recorded previously)
and 'recordedmarkup' (keyframe seek info, commercial skipping, etc).

grep "INSERT INTO record "   mythtv_backup.sql > restore.sql
grep "INSERT INTO recorded " mythtv_backup.sql >> restore.sql
grep "INSERT INTO oldrecorded " mythtv_backup.sql >> restore.sql
grep "INSERT INTO recordedmarkup " mythtv_backup.sql >> restore.sql

Note the space after the table name and the ">>" to append to the
file for all but the first grep. "recordedmarkup" is huge and
may be hundreds of thousands of lines if you had lots of hours
of recordings.

If your hostname has changed, bring up restore.sql in an editor
to search and replace your old hostname with the new one being
careful to not replace if your old hostname appears in a show's title or description ;-).

Once your file is ready to go:

$ mysql -u mythtv -pmythtv mythconverg < restore.sql

If something goes terribly wrong you can:

$ mysql -u mythtv -pmythtv mythconverg
mysql> delete from record
mysql> delete from recorded
mysql> delete from oldrecorded
mysql> delete from recordedmarkup

then start over.

--  bjm

More information about the mythtv-users mailing list