[mythtv-users] Moving recordings between MythTV systems

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Sep 2 01:31:28 UTC 2016


On Thu, 1 Sep 2016 22:34:53 +0200, you wrote:

>Hoi Mike,
>
>Thursday, September 1, 2016, 10:20:53 PM, you wrote:
>
>> I built up a fresh Mythbuntu 16.04 0.28 system as a test case before 
>> migrating my production system to 0.28. I would like to add the 
>> recordings from the production system (backed up to NAS) to the test 
>> system database. The NAS directory containing the recordings backup is
>> already mounted on the test system. Is there a way to make it happen? 
>> I've been trying to find info on it but there doesn't seem to be 
>> anything newer than 2008 or so.
>
>> Hope someone can help.
>
>> mike
>
>The only real option is importing them into the video database. I       
>think there is a wiki article about how to do this.
>
>
>Tot mails,
>  Hika                            mailto:hikavdh at gmail.com

You can use the mythexport package - this is one of its functions.
Install it and go to its web page (usually http://<your mythtv
box>/mythexport), then select the "On the Go" page.  It will display a
list of all the recordings in the database.  Select the ones you want
to export and a directory to export them to and click Go.  It will
create a .sql file in that directory containing all the data for those
recordings, and then will copy the recording files to that directory.
If you only need the database data, as soon as you see it copying the
recording files, you can go to its Job Queue page and delete the job.
That will leave you with the SQL data you need.  Move the .sql file
(and the recordings files) to the box where you want them, install
mythimport in that box and run it.  It will read the .sql file and
import all that data.  You need to manually move the recording files
into directories that are part of the storagegroups on that box.  Then
the recordings will be available on that box just as they are on the
original one.  I do this all the time copying things from my MythTV
box and my mother's when we are away from home and need to use the
recordings on my laptop.

Warnings:

1) If you are using MariaDB, there is currently a bad dependency in
the mythexport and mythimport Ubuntu packages so they depend on real
MySQL being installed and installing them will uninstall MariaDB and
install MySQL. So you would need to download those package files,
unpack the contents and manually install the files in the correct
places.

2) If you import a recording into a database it already exists in, the
mythimport process stops in the middle where the error occurs.  All
prior recordings will have been fully imported, and all subsequent
ones will not have been imported.  The failed recording normally has
not been imported at all as the failure occurs on duplicate primary
key of the table and the tables involved do not allow duplicates.  If
that happens to you, you will need to reexport all the subsequent
recordings, or you can edit the .sql file and delete all the SQL in it
that applies to all the recordings already imported (from the start of
the file to the failed recording), and of course the failed one.  Then
run mythimport again.  The SQL file can be huge, so your favourite
text editor may not be capable of editing it - you need one that can
handle very large text files.  That large size is because of the
recordedseek table, which is very large for each recording.  The
formatting of the exported SQL is a pain to edit, as it uses extremely
long lines.

3) I have not yet actually used mythexport/mythimport on 0.28, but the
packages are there for 0.28 so I presume it works.

I have also written myself some experimental Python code that does the
same export and import of the SQL data for recordings (in 0.27 only so
far), that allows me to share recording files across my network so
that my mother can play recordings I make for her on my box, directly
from the recording file on my box.  The part of the code that does the
export and import of the SQL data is working, but the rest is not yet
ready for anyone else to use.


More information about the mythtv-users mailing list