[mythtv-users] Merging data from two mythbackend servers

Nick Morrott knowledgejunkie at gmail.com
Sat Sep 13 03:58:16 UTC 2008


On 13/09/2008, Gary Holmlund <gary.holmlund at gmail.com> wrote:
> I have had two independent mythbackend servers. I just built a new
>  computer with lots of disk space and I would like to move the recorded
>  files from the old servers to the new. The documentation has a great
>  procedure for moving data from one server to a new one.
>     http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7
>
>  This does not work for the second server's data because of duplication
>  of keys in the database. Specifically I get the following error:
>    ERROR 1062 (23000) at line 1: Duplicate entry '81' for key 1
>
>  Does anyone know of a procedure that would allow me to load the second
>  server's data onto the new server?

It'll probably have to be a manual procedure. First task is to check
the SQL backup file from the second server, and determine which table,
and which entry has the value '81'. It's likely a recording rule with
recordid=81. As recordid is the primary key (PK) in the record table,
you can't have duplicates, hence the error.

What I would do is check the tables you are trying to import, and see
whether there are any other duplicates for the primary keys on the
imported tables (you can check the structure from the mysql command
line, or using a tool such as phpMyAdmin). You will also need to
ensure that hostnames are corrected for the new host in the recorded
table, so that the new installation can find all of the imported
recordings.

It's certainly possible, but you'll need to do some careful planning
for the process to go smoothly.

-- 
Nick Morrott

MythTV Official wiki:
http://mythtv.org/wiki/
MythTV users list archive:
http://www.gossamer-threads.com/lists/mythtv/users

"An investment in knowledge always pays the best interest." - Benjamin Franklin


More information about the mythtv-users mailing list