| 284 | | <P>The first step is to create a database backup as demonstrated in an earlier |
| 285 | | section.</P> |
| 286 | | <P>Next, you will extract only the data that is relevant to the programs: |
| 287 | | <BLOCKQUOTE><CODE> |
| 288 | | <PRE> |
| 289 | | $ grep "INSERT INTO record " mythtv_backup.sql > restore.sql |
| 290 | | $ grep "INSERT INTO recorded " mythtv_backup.sql >> restore.sql |
| 291 | | $ grep "INSERT INTO oldrecorded " mythtv_backup.sql >> restore.sql |
| 292 | | $ grep "INSERT INTO recordedprogram " mythtv_backup.sql >> restore.sql |
| 293 | | $ grep "INSERT INTO recordedrating " mythtv_backup.sql >> restore.sql |
| 294 | | $ grep "INSERT INTO recordedmarkup " mythtv_backup.sql >> restore.sql |
| 295 | | $ grep "INSERT INTO recordedseek " mythtv_backup.sql >> restore.sql |
| 296 | | </PRE> |
| 297 | | </CODE></BLOCKQUOTE> |
| 298 | | </P> |
| 299 | | <P><B>NOTE</B>: Newer versions of <B>mysqldump</B> place backticks around |
| 300 | | the table names. Backticks are not the same as apostrophes! On a typical |
| 301 | | North American keyboard, backticks are located to the left of the "1" key, |
| 302 | | on the same key as the tilde. Also, because the <B>bash</B> shell may try |
| 303 | | to interpret the backticks, make sure you use a \ before each one.</P> |
| 304 | | <P>If your <CODE>restore.sql</CODE> file is empty, you'll need to re-run the |
| 305 | | commands like this: |
| 308 | | $ grep "INSERT INTO \`record\` " mythtv_backup.sql > restore.sql |
| 309 | | $ grep "INSERT INTO \`recorded\` " mythtv_backup.sql >> restore.sql |
| 310 | | $ grep "INSERT INTO \`oldrecorded\` " mythtv_backup.sql >> restore.sql |
| 311 | | $ grep "INSERT INTO \`recordedprogram\` " mythtv_backup.sql >> restore.sql |
| 312 | | $ grep "INSERT INTO \`recordedrating\` " mythtv_backup.sql >> restore.sql |
| 313 | | $ grep "INSERT INTO \`recordedmarkup\` " mythtv_backup.sql >> restore.sql |
| 314 | | $ grep "INSERT INTO \`recordedseek\` " mythtv_backup.sql >> restore.sql |
| | 286 | $ mysqldump -l -n -t -c -p -u mythtv mythconverg record recorded oldrecorded recordedprogram recordedrating recordedmarkup recordedseek > restore.sql |