[mythtv-users] changing channel lineups

Michael T. Dean mtdean at thirdcontact.com
Tue Mar 7 04:02:29 UTC 2006


On 03/06/2006 10:22 PM, Robert Tsai wrote:
> Are there any kind of "best practices" for changing channel lineups
> while having a bunch of stored recordings (e.g., moving, or otherwise
> changing television service)?
>
> The problem is that when you re-setup all the channels, etc., certain
> chanids might get re-used, so that a given chanid in one place is
> either non-existent or something else in another place, which would
> then cause the recordings info to be incorrect.
>
> The only thing I can think of is to kind of "move" all the old
> recordings into a separate range of chanids that won't conflict with
> the new chanids, save that off, re-scan for channels, and then merge
> the saved-off information back in. Eventually when the recordings get
> deleted, I can delete the old channel information.
>
> Any other ideas?

If you leave your videosource and channels for the old source defined 
when you define your new videosource and channels, you definitely won't 
get any re-used chanid's (and you could then delete the videosource 
afterwards if you want).  If you do not reset the sourceid 
auto_increment field in the videosource table, you almost definitely 
won't get any reused chanid's--whether you delete the videosource and/or 
channels before creating the new ones.  See 
http://www.gossamer-threads.com/lists/mythtv/dev/160587#160587 for info 
on how mythfilldatabase creates chanid's.

To ensure you don't reset the auto_increment, don't select "Delete All" 
from mythtv-setup or do a "TRUNCATE TABLE" (or, in some older versions 
of MySQL, don't do a "DELETE FROM") and don't explicitly reset the 
auto_increment (with "ALTER TABLE").  By doing this, you're ensuring 
that the new videosource gets a different sourceid from the original.  
However, it does mean that once you delete the old videosource, your 
sourceid's will no longer be a pretty list starting at 1.

Mike


More information about the mythtv-users mailing list