http://www.mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7
23.7 Moving your data to new hardware
This assumes that you will be moving your data to newer / bigger hardware and don't want to lose your programs.
The first step is to create a database backup as demonstrated in an earlier section.
Next, you will extract only the data that is relevant to the programs:
$ 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 recordedprogram " mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO recordedrating " mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO recordedmarkup " mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO recordedseek " mythtv_backup.sql >> restore.sql
NOTE: Newer versions of mysqldump place backticks around the table names. Backticks are not the same as apostrophes! On a typical North American keyboard, backticks are located to the left of the "1" key, on the same key as the tilde. Also, because the bash shell may try to interpret the backticks, make sure you use a \ before each one.
If your restore.sql file is empty, you'll need to re-run the commands like this:
$ 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 \`recordedprogram\` " mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO \`recordedrating\` " mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO \`recordedmarkup\` " mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO \`recordedseek\` " 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" and "recordedseek" are huge and there may be hundreds of thousands of lines if you had lots of hours of recordings.
After you have moved the data files to the new hardware, configure MythTV using the mythtv-setup program as you normally would with a standard MythTV installation.
At this point we will restore the information about your programs back into the database:
$ mysql -u mythtv -pmythtv mythconverg < restore.sql
After successful insertion of the data you may delete the restore.sql file.