MythTV Rebuild
I wanted to grab the large HDD out of my MythTV box so I can take that with me to Vancouver. So I swapped it for a 160GB I had sitting around. It all went surprisingly well. Here's what I did:
1. Installed Mythbuntu on the new disk
2. Once that's booted stop mysql (sudo /etc/init.d/mysql stop)
3. Copy the database files from the old partition, they can be found in /var/lib/mysql/mythconverg. It pays to make a backup but make sure you don't leave it in /var/lib/mysql or mysql will try to use it as a database.
4. Copy the old recordings to the new recordings folder on the new drive.
Now I was at a point were I could watch recordings (Yay!). Live TV and recordings still wouldn't work. I noticed in system settings that the tuners were both unavailable. to fix this run MythTV setup and delete all the capture cards and recreate them.
I also had a quirk where mythweb gave an error that the table weatherscreens didn't exist. I rebuild the tables using this process
1. Connect to mysql using the syntax mysql -u mythtv -p
2. Enter the password from /home/mythtv/.mythtv/mysql.txt
3. Type use mythconverg;
4. Enter these commands to build the tables:
DROP TABLE IF EXISTS `weathersourcesettings`;
CREATE TABLE `weathersourcesettings` (
`sourceid` int(10) unsigned NOT NULL auto_increment,
`source_name` varchar(64) NOT NULL,
`update_timeout` int(10) unsigned NOT NULL default '600',
`retrieve_timeout` int(10) unsigned NOT NULL default '60',
`hostname` varchar(255) default NULL,
`path` varchar(255) default NULL,
`author` varchar(128) default NULL,
`version` varchar(32) default NULL,
`email` varchar(255) default NULL,
`types` mediumtext,
PRIMARY KEY (`sourceid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `weatherscreens`;
CREATE TABLE `weatherscreens` (
`screen_id` int(10) unsigned NOT NULL auto_increment,
`draworder` int(10) unsigned NOT NULL,
`container` varchar(64) NOT NULL,
`hostname` varchar(255) default NULL,
`units` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`screen_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `weatherdatalayout`;
CREATE TABLE `weatherdatalayout` (
`location` varchar(64) NOT NULL,
`dataitem` varchar(64) NOT NULL,
`weatherscreens_screen_id` int(10) unsigned NOT NULL,
`weathersourcesettings_sourceid` int(10) unsigned NOT NULL,
PRIMARY KEY (`location`,`dataitem`,`weatherscreens_screen_id`,`weathersourcesettings_sourceid`),
KEY `weatherdatalayout_FKIndex1` (`weatherscreens_screen_id`),
KEY `weatherdatalayout_FKIndex2` (`weathersourcesettings_sourceid`),
CONSTRAINT `weatherdatalayout_ibfk_1` FOREIGN KEY
(`weatherscreens_screen_id`) REFERENCES `weatherscreens` (`screen_id`)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `weatherdatalayout_ibfk_2` FOREIGN KEY
(`weathersourcesettings_sourceid`) REFERENCES `weathersourcesettings`
(`sourceid`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `weathersourcesettings` (
`sourceid` int(10) unsigned NOT NULL auto_increment,
`source_name` varchar(64) NOT NULL,
`update_timeout` int(10) unsigned NOT NULL default '600',
`retrieve_timeout` int(10) unsigned NOT NULL default '60',
`hostname` varchar(255) default NULL,
`path` varchar(255) default NULL,
`author` varchar(128) default NULL,
`version` varchar(32) default NULL,
`email` varchar(255) default NULL,
`types` mediumtext,
PRIMARY KEY (`sourceid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `weatherscreens`;
CREATE TABLE `weatherscreens` (
`screen_id` int(10) unsigned NOT NULL auto_increment,
`draworder` int(10) unsigned NOT NULL,
`container` varchar(64) NOT NULL,
`hostname` varchar(255) default NULL,
`units` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`screen_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `weatherdatalayout`;
CREATE TABLE `weatherdatalayout` (
`location` varchar(64) NOT NULL,
`dataitem` varchar(64) NOT NULL,
`weatherscreens_screen_id` int(10) unsigned NOT NULL,
`weathersourcesettings_sourceid` int(10) unsigned NOT NULL,
PRIMARY KEY (`location`,`dataitem`,`weatherscreens_screen_id`,`weathersourcesettings_sourceid`),
KEY `weatherdatalayout_FKIndex1` (`weatherscreens_screen_id`),
KEY `weatherdatalayout_FKIndex2` (`weathersourcesettings_sourceid`),
CONSTRAINT `weatherdatalayout_ibfk_1` FOREIGN KEY
(`weatherscreens_screen_id`) REFERENCES `weatherscreens` (`screen_id`)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `weatherdatalayout_ibfk_2` FOREIGN KEY
(`weathersourcesettings_sourceid`) REFERENCES `weathersourcesettings`
(`sourceid`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Done, now mythweb works too.
Comments