<div dir="ltr"><div class="gmail_quote">On Thu, Sep 18, 2008 at 11:42 PM, Nick Morrott <span dir="ltr">&lt;<a href="mailto:knowledgejunkie@gmail.com">knowledgejunkie@gmail.com</a>&gt;</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 &lt;<a href="mailto:mtdean@thirdcontact.com">mtdean@thirdcontact.com</a>&gt; wrote:<br>&gt; On 09/18/2008 08:14 PM, Nick Morrott wrote:<br>&gt;<br>&gt; &gt; On 18/09/2008, Nick F wrote:<br>
&gt; &nbsp;&gt;&gt; Is there a way to copy all the recorded shows from one machine to the other<br>&gt; &nbsp;&gt;&gt; then insert all the database records relating to recorded shows into that<br>&gt; &nbsp;&gt;&gt; database? &nbsp;I realise this is something that needs to be done manually, but<br>
&gt; &nbsp;&gt;&gt; are there any mysql commands that could make it easier? &nbsp;What tables would I<br>&gt; &nbsp;&gt;&gt; need to copy?<br>&gt; &nbsp;&gt;&gt;<br>&gt; &nbsp;&gt; One possible method is in the MythTV documentation:<br>&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; <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>&gt; &nbsp;&gt;<br>&gt; &nbsp;&gt; The &#39;record&#39; table holds your recording schedules, the others details<br>
&gt; &nbsp;&gt; of your actual recordings.<br>&gt;<br>&gt;<br>&gt; Though you may have index/key uniqueness violations if both systems use<br>&gt; &nbsp;the same chanid(s) (and you happened to have a recording on at the same<br>&gt; &nbsp;time on both). &nbsp;Note, also that there&#39;s a better approach than 23.7 at<br>
&gt; &nbsp;<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>&gt; &nbsp;didn&#39;t mention it because I can&#39;t guarantee it will work because of the<br>
&gt; &nbsp;index/key issue and I don&#39;t have time to do much more than provide a<br>&gt; &nbsp;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&#39;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&#39;ll post information below about my understanding of the key<br>relations of the tables that the &#39;Moving your data to new hardware&#39;<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>&nbsp;</div>
<div>Thanks all for the helpful links, suggestions, and details.</div>
<div>&nbsp;</div>
<div>I&#39;ll back up my database and give it a try when I&#39;ve got some time to sit down.&nbsp; Unfortunately I&#39;ve got a lot of recordings to merge, so the purely manual method will be difficult.&nbsp; I&#39;ll report back with my success or failure!<br>
</div></div>