[mythtv-users] How to import old mythtv recordings?
John Pilkington
J.Pilk at tesco.net
Wed Oct 11 08:37:10 UTC 2006
Gave problems but now Solved: see below.
Michael T. Dean wrote:
>>>> On 10/08/2006 07:02 AM, John Pilkington wrote:
>>>>
>>>>> I have a few mythtv recordings made under FC3 which are between 6 and 20
>>>>> months old. The FC3 system still exists, on the same machine as the
>>>>> current FC5 0.20 installation. Please can anyone suggest how I should
>>>>> go about importing them, with their metadata, into the current system?
>>>>>
>>>>>
>>>> http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.5
>>>>
>>>> http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7
>>>>
>>> Thanks: sorry I'd forgotten reading this!
>>>
>> Now I've tried it - and have problems :-(
>> The first attempt to perform the final merge produced a response saying
>> (IIRC) that it needed an explicit setting for 'bookmark'. Subsequent
>> attempts yield
>>
>>> ERROR 1062 (23000) at line 1: Duplicate entry '2' for key 1
>>>
>>>
The initial lines of mysqldump output on the two systems showed for FC3
>> -- MySQL dump 8.23 Server version 3.23.58
> and for the FC5 system
>> -- MySQL dump 10.10 Server version 5.0.22
> You're trying to merge data from an old version of Myth into a MythTV
> 0.20 database. The database structure has changed enough that this
> won't work. You can a) edit the SQL statements from the ss23.7 "partial
> restore" and manually update the INSERT statements for the new database
> structure or b) do it the old-fashioned way (but also
> manually-intensive) with myth.rebuilddatabase.pl or c) allow MythTV to
> upgrade your old database, then do ss23.5 and ss23.7 and import that
> into the new database.
This worked :-} and was fairly painless:
In FC3 do ss23.5 (dump database)
In FC5 create a new database (NOT mythconverg) from the above dump.
Do ss23.7 ( as specified for later versions) to extract the required
lines from the new database.
The 'Duplicate entry' error that I reported above probably wasn't
relevant now, but I took steps to avoid it again as Mike suggests:
> You've already INSERTed some of the data, so you get an error when you
> try and INSRET it again. You can change all the INSERTs in the SQL file
> to "REPLACE INTO" (no quotes) and it should work--once you also fix the
> issues described above.
I tried hacking this example from ss23.15:
> cat mythtv_backup.sql | sed s/\'frontend1\'/\'kidsroom\'/g >> mythtv_restore.sql
and eventually :-( this worked :-)
> cat restore.sql | sed 's/INSERT INTO/REPLACE INTO/g' >> fc3_restore.sql
followed by
> mysql -u mythtv -pmythtv mythconverg < fc3_restore.sql
as from ss23.7
Everything was there (the recordings had been moved earlier) - but
several were marked for autodeletion. It would make sense to turn this
off first!
Thanks for the help,
John Pilkington
More information about the mythtv-users
mailing list