[mythtv-users] Restoring Select Database Files

Bruce Markey bjm at lvcm.com
Sun Dec 18 13:59:39 EST 2005


Michael Starks wrote:
> Hello Mythers.  I had a drive go south on me and eventually decided to
> rebuild the system from scratch on different hardware.  During the
> process of the drive failing, the database was corrupted.  I *do* have
> backup but not as far back as I need to get a good, clean copy of the
> database, so the backup will only be partially useful.
> 
> The database backup is essentially just the files in
> /var/lib/mysql/mythconverg, so I am hoping I can simply replace key
> files to get back what I need.  I am hoping to only restore the tables
> of what has been recorded (about 350GB worth of recordings, minus one or
> two corrupt files), commercial cut points, scheduled recordings and
> previously recorded.  Everything else I can recreate.  What files will
> need to be restored for that?  Thanks in advance.

Well, you're surrendering before you lost. First thing to try
is to restore copies of all /var/lib/mysql/mythconverg files and
run "mysqlcheck -r -u mythtv -pmythtv mythconverg" and you're done.
However, if this doesn't work, the assumption that the tables
you need are fine and other meaningless tables are corrupt is
unrealistic. The most likely table to be borked is the "commercial
cut points" table recordedmarkup but this can be recreated with
mythcommflag. The most important table with the basic information
about your recordings is "recorded" so you can associate titles
and episodes with files. If you can not recover this tables, there
is contrib/myth.rebuilddatabase.pl to at least make entries for
each file but with no info about what program is in the file.
"record" is your list of rules and is a PITA start over from scratch
if you can't recover this table. The previously recorded table
"oldrecorded" isn't that critical. Without it, if you see an episode
scheduled to record that sounds familiar, mark it Never record.
This is incidental compared to recreating all your rules from memory.

In the future you may want to have text backups that are much easier
to manipulate and pluck out parts.

http://www.mythtv.org/docs/mythtv-HOWTO-23.html#ss23.5

--  bjm



More information about the mythtv-users mailing list