<div dir="ltr"><div class="gmail_quote">On Thu, Sep 18, 2008 at 11:42 PM, Nick Morrott <span dir="ltr"><<a href="mailto:knowledgejunkie@gmail.com">knowledgejunkie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">On 19/09/2008, Michael T. Dean <<a href="mailto:mtdean@thirdcontact.com">mtdean@thirdcontact.com</a>> wrote:<br>> On 09/18/2008 08:14 PM, Nick Morrott wrote:<br>><br>> > On 18/09/2008, Nick F wrote:<br>
> >> Is there a way to copy all the recorded shows from one machine to the other<br>> >> then insert all the database records relating to recorded shows into that<br>> >> database? I realise this is something that needs to be done manually, but<br>
> >> are there any mysql commands that could make it easier? What tables would I<br>> >> need to copy?<br>> >><br>> > One possible method is in the MythTV documentation:<br>> ><br>
> > <a href="http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7" target="_blank">http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7</a><br>> ><br>> > The 'record' table holds your recording schedules, the others details<br>
> > of your actual recordings.<br>><br>><br>> Though you may have index/key uniqueness violations if both systems use<br>> the same chanid(s) (and you happened to have a recording on at the same<br>> time on both). Note, also that there's a better approach than 23.7 at<br>
> <a href="http://www.mythtv.org/wiki/index.php/Database_Backup_and_Restore" target="_blank">http://www.mythtv.org/wiki/index.php/Database_Backup_and_Restore</a> , but I<br>> didn't mention it because I can't guarantee it will work because of the<br>
> index/key issue and I don't have time to do much more than provide a<br>> link, now.<br><br></div>The thread <a href="http://www.gossamer-threads.com/lists/mythtv/users/349161" target="_blank">http://www.gossamer-threads.com/lists/mythtv/users/349161</a><br>
from some days ago on the exact same topic provides some discussion<br>and warning about these issues. If you don't have many entries, the<br>manual procedure described is fairly straightforward, but it does<br>require editing the raw data and updating the database directly. As<br>
Mike states, you have to be very careful to ensure there are no<br>clashes between unique fields in the two datasets, and to update any<br>related table data you are also importing if you do have to change one<br>of the unique values. You will also have to ensure that you update any<br>
host names in the data to point to the new machine.<br><br>I'll post information below about my understanding of the key<br>relations of the tables that the 'Moving your data to new hardware'<br>section mentions so that it hits the list archive, in the hope that it<br>
is of use to someone in the future (this is from a 0.21-fixes system)<br>planning to merge data from multiple machines manually:<br><br>TABLE: record<br>UNIQUE FIELD: record.recordid (autoincremented)<br>INHERITS/LINKS: record.chanid from channel.chanid<br>
RELATED TABLES: record.recordid used in recorded.recordid, oldrecorded.recordid;<br>NOTABLE FIELDS: storagegroup<br><br>TABLE: recorded<br>UNIQUE FIELD: recorded.chanid + recorded.starttime<br>INHERITS/LINKS: recorded.chanid from channel.chanid<br>
RELATED TABLES:<br>NOTABLE FIELDS: hostname and storagegroup<br><br>TABLE: recordedprogram<br>UNIQUE FIELD: recordedprogram.chanid + recordedprogram.starttime +<br>recordedprogram.manualid<br>INHERITS/LINKS: recordedprogram.chanid from channel.chanid<br>
<br>TABLE: recordedrating<br>UNIQUE FIELD: recordedrating.chanid + recordedrating.starttime +<br>recordedrating.system + recordedrating.rating<br>INHERITS/LINKS: recordedrating.chanid from channel.chanid<br><br>TABLE: recordedmarkup<br>
UNIQUE FIELD: recordedmarkup.chanid + recordedmarkup.starttime +<br>recordedmarkup.type + recordedmarkup.mark<br>INHERITS/LINKS: recordedmarkup.chanid from channel.chanid<br><br>TABLE: recordedseek<br>UNIQUE FIELD: recordedseek.chanid + recordedseek.starttime +<br>
recordedseek.type + recordedseek.mark<br>INHERITS/LINKS: recordedseek.chanid from channel.chanid<br><br>TABLE: oldrecorded<br>UNIQUE FIELD: oldrecorded.station + oldrecorded.starttime + oldrecorded.title<br>INHERITS/LINKS: oldrecorded.chanid from channel.chanid,<br>
oldrecorded.recordid from record.recordid, oldrecorded.station from<br>channel.callsign<br><br><br>The record.recordid field is an autoincrement field, therefore care<br>must be taken to update conflicting values to values that either slot<br>
into gaps in the range of recordid values, or that the autoincrement<br>counter for the record table is updated to reflect an increased<br>recordid maximum value (see<br><a href="http://www.gossamer-threads.com/lists/mythtv/users/349238#349238" target="_blank">http://www.gossamer-threads.com/lists/mythtv/users/349238#349238</a>).<br>
<br>The related recorded* tables essentially include one or more values<br>(chanid, starttime...) from the recorded table, so these values should<br>agree across all of these tables. If one of the values in<br>mythconverg.recorded has to be updated, also update the value across<br>
the other related recorded* tables.<br><br>The oldrecorded table keeps details of your recording history, so for<br>some users this may be the only table they need to import if they do<br>not want to also import their existing recordings and schedules. To<br>
ensure that duplicate matching continues to work properly the station<br>field should agree with the new installation.<br><br>Cheers,<br>
<div class="Ih2E3d">Nick</div></blockquote></div>
<div> </div>
<div>Thanks all for the helpful links, suggestions, and details.</div>
<div> </div>
<div>I'll back up my database and give it a try when I've got some time to sit down. Unfortunately I've got a lot of recordings to merge, so the purely manual method will be difficult. I'll report back with my success or failure!<br>
</div></div>