[mythtv-users] Rebuild then reimport recorded programs data

Bruce Markey bjm at lvcm.com
Fri May 7 15:26:13 EDT 2004


Tim Litwiller wrote:
> I rebuilt my mythtv last night - I save the whole mythconverge database 
> before I started  so I could import the information of previously 
> recored programs.
> 
> Which data tables need to be imported back into mythconverge?

When you first run setup, mythbackend or mythtfrontend, 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