[mythtv-users] partial restore of database from backup

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Oct 21 15:29:13 UTC 2019


On Mon, 21 Oct 2019 10:59:06 -0400, you wrote:

>Like many I do daily backup of my mythtv database. However, I've only 
>used that backup when building a new setup of hardware that will 
>hopefully be doing the same function as the old one, once the database 
>is restored and the recordings copied to the right directories.
>
>What I'm doing now is different and not sure if the saved database can 
>help.  I'm build an additional mythtv backend that will be used to 
>record some of the same programs but it started with a clean database. 
>Both backends are set to record for example "NCIS". My main backend has 
>been recording those since the beginning of the series so when a rerun 
>comes on it will not record it again because it once recorded it long 
>ago, even though it's been watch and deleted.
>
>The new backend will recorded it because it has no history.  Some of the 
>reruns are not tagged as such and using that record flag doesn't solve 
>the problem.
>
>So my question is, can I export the record history of a program or all 
>programs from one backend to another so the new backend will not waste 
>time recording something that's already be seen?
>
>I know that there are easy ways to just delete the recording, but I'm 
>curious if this can be done.
>
>There are several reasons I want to do this, but one is I want to avoid 
>my wife deleting a program we both watch that I have not seen yet. The 
>"watched" icon doesn't always get noticed by her.
>
>Jim A

The information you want is in the oldrecorded table.  But it is not
possible to just export that table from one database and expect it to
work in another database as things like the chanid values will not
refer to the same channel (unless you have also exported all the
channel data).  If you really know what you are doing, you might be
able to write some code that translated all the fields in the
oldrecorded table correctly to match the new database, but it would be
specific code for those two databases.

If you really want to do this, the only easy way would be to create
the new system using a full backup of the old system, then adjust its
settings to match the new system's hardware (tuners, disk partitions,
...).  Then you would need delete all the data you do not need (all
the recordings that are only on the old system, for example).  You
could just run find_orphans.py and let it tidy up the database for all
the missing recordings.


More information about the mythtv-users mailing list