Import/Merge Previously Recorded Table from Differnet Backend?

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
Vaska
Junior
Posts: 57
Joined: Fri Sep 01, 2017 11:09 pm
Canada

Import/Merge Previously Recorded Table from Differnet Backend?

Post by Vaska »

Hi,

I had a 2nd, seperate backend running where I used to work where we had unencrypted cable. I would bring the recorded shows home weekly and put them in my Videos folder. It worked good enough for good WAF. I've left that job but I do have a backup of the previously recorded shows table from that server that I would like to import into my backend just in case we ever have access to those shows and don't want duplicates recorded.

I thought I could just run this command using a trimmed down copy of the exported previously recorded table:
/usr/bin/mysql -uroot -notmypassword -hlocalhost mythconverg < 2019-03-15.MySQL.Previously-Recorded-Shows

I got this error/complaint when I ran it and am not sure if it imported all the data:
ERROR 1062 (23000) at line 4: Duplicate entry 'WTMJ-DT-2018-05-20 03:29:00-Saturday Night Live' for key 'PRIMARY'

The trimmed down file (2019-03-15.MySQL.Previously-Recorded-Shows) I'm trying to import, looks like this (I cut the long lines for post):

LOCK TABLES `oldrecorded` WRITE;
/*!40000 ALTER TABLE `oldrecorded` DISABLE KEYS */;
INSERT INTO `oldrecorded` VALUES (2501,'2017-08-23 00:00:00','2017-08-23 01:00:00','Fixer Upper','....)
INSERT INTO `oldrecorded` VALUES (1121,'2019-03-19 23:00:00','2019-03-19 23:30:00','WISN 12 News',....)
/*!40000 ALTER TABLE `oldrecorded` ENABLE KEYS */;
UNLOCK TABLES;

Can the Error 1062 be ignored, or did I remove too many of the commands from the mysqlbackup previously recorded table for the import/merge to work correctly? Some of the commands I removed were like this:

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `oldrecorded`
--

DROP TABLE IF EXISTS `oldrecorded`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oldrecorded` (
`chanid` int(10) unsigned NOT NULL DEFAULT '0',
`starttime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`endtime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
.....etc.....
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Post Reply