Author Topic: Importing KnoppMyth's database  (Read 2796 times)

Eirik

  • Regular Poster
  • **
  • Posts: 16
    • View Profile
Importing KnoppMyth's database
« on: May 13, 2007, 07:42:45 am »
I just finished my migration to LinuxMCE and wanted to write this down someplace, hope it helps someone.

Hopefully you did a backup and saved the files from /myth/backup. :)

After you have MythTV working (able to watch TV) you can restore parts of the databases you want to keep. For example to import your `oldrecorded` table.

gzip -d mythconverg.sql
grep -n "DROP TABLE" mythconverg.sql
[....]
1186:DROP TABLE IF EXISTS `oldfind`;
1207:DROP TABLE IF EXISTS `oldprogram`;
1228:DROP TABLE IF EXISTS `oldrecorded`;
1271:DROP TABLE IF EXISTS `people`;
1294:DROP TABLE IF EXISTS `phonecallhistory`;
1319:DROP TABLE IF EXISTS `phonedirectory`;
[....]
sed -n '1228,1270 p' mythconverg.sql > oldrecorded.sql
mysql -D mythconverg < oldrecorded.sql

The first sed number (1228) is the line matching the table we want, the second (1270) is -1 of the next table.

Repeat for any other tables you want to import.

If you had any tv shows recorded you can import them as well. Move the files into the /home/public/data/tv_shows_1 (or tv_shows_0 not sure the difference but this worked for me) directory and import the 'recorded' table. Then restart the mythtv-backend.

Not sure if it was needed, but in the logs it yelled at me so I ran:

for each in `ls *.mpg`; do mythcommflag --file $each --rebuild; done

inside the tv_shows_1 directory as well.

oldrecorded = shows recorded in the past
recorded = shows currently recorded
record = shows to record

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: Importing KnoppMyth's database
« Reply #1 on: May 14, 2007, 02:22:21 am »
Good work but perhaps this would be better put in the documentation (Wiki) perhaps.

Regards
Darren