[mythtv-users] Merging old database with new

George Nassas gnassas at mac.com
Mon Jul 12 13:34:20 UTC 2010

On 7/8/2010 16:54, Nathan Carlson wrote:
> My question is, what is the best way to merge the two databases? Is there a way to import the backup and have it ignore duplicates, while leaving newly recorded show records intact? Any experience merging databases from the community?

The quick and dirty approach would be to dump the "recorded" table on the source machine and import it on the target. After that copy your recordings over. Take note of the filenames and do something like "mythcommflag --rebuild --file X --queue" for each. Be sure to check the dump file to make sure it doesn't have a drop and create for the recorded table.

Of course, you won't get any of the recording rules or recording histories and if the lineups don't match the imported shows will appear on different channels.

To check for duplicates you could capture the output of "select basename from recorded order by basename" from each box and diff showing only common lines. Go back from filename to show with "select * from recorded where basename = '??'" and delete the dupes from one host or the other.

Like I said, it's dirty but you'll have the shows and I think that's the important thing. Anything more would be an involved project.

- George

P.S. Before you start... take a backup!

More information about the mythtv-users mailing list