Changing the hostname of anything that's been near mythtv is a pain in the ass. There's a howto using an offline copy of the data that I probably should have followed, but I didn't so after giving myself a world of problems, I'm going to try and work with the data online with phpMyAdmin. Seriously hardcore users could go with an interactive mysql session, but it's not amazing for browsing data quickly. Watch out for name collisions though, lucifer, my new backend used to run as a frontend, so using the method above I'd have to do the following 3 way swap.
lucifer -> temp //Rename old frontend
smaug -> lucifer // change name of backend
temp -> smaug
Installing phpMyAdmin is seriously easy if you grab it through aptitude, and a lot less annoying than deploying it the hard way. Slightly confusingly that apache configuration uses an alias directive, so if you've got apache showing you the folders inside /var/www, it won't show up, but pointing your browser at http://hostname/phpMyAdmin should work. It occurred to me a few days ago that you don't need phpMyAdmin to be installed on the same host as your database, bit if the mysql server is only listening for local connections, an ssh tunnel can be really handy.
[code lang=bash]ssh -L localport:localhost:remoteport user@remotehost[/code]
The above makes the remoteport on the remotehost accessible on localhost, handy when you want a GUI wrapped round an unfriendly database.
A quick browse of the tables and I can find references to about 5 backends that were temporarily in use and and about 15 different frontend names. Time for some serious pruning before I run out of Hobbit/Lord of the Rings character names...
Working through the database, capturecard can be pruned of entries for cards that don't exist, and if you haven't prodded mythtv-setup you can move cards from host to host by changing the hostname of incorrect records.
cardinput then needs pruning of missing capturecards, the cardid fileds of both tables should match. The table inputgroup then needs pruning of missing cardinputids
channel doesn't appear to have crufted, but tweaking the icon field here is probably easier than using mythtv-setup. Icons for BBC channels don't seem to work for me so I'll come back here later.
displayprofilegroups and displayprofiles can be pruned of old hosts. Each displayprofilegroup matches 36 records in displayprofiles, so I had a lot of cruft, so I wrote down the list of profilegroupid I wanted to remove and fired up an interactive mysql session, and turned autocommit off in case I made a mistake.
housekeeping can be pruned of non-existant backend hosts, as can jumppoints and keybindings.
It may seem like I've gone through a lot of effort for the sake of saving about 2MB in 20MB database, but it's more an issue of avoiding strange behaviour should I suddenly bring in a new backend or frontend. Last night I put mythfrontend and mythvideo on my desktop so I could watch a dvd in bed (dragon player and totem were choking on the menus), and I ran into a load of strange settings from when the name my desktop currently has was my 'experimental' box. The moral of this story is probalby something about reusing hostnames, but it is a mighty PITA trying to think of new ones and I'm much more likely to rember a name with a theme than a numericly named box, and nameing by role is even more of a pain as I tend to repurpose things regularly. The flipside of this is it's much easier on non-techs (/me considers using 'Lo-tek' but I might just have some William Gibson flavour trouble....)
Of course it's a really good idea to leave a note on the machine saying you're working on it, just in case other users decide that the best way to fix a trivial issue (in this case DVDs not playing because I hadn't installed libdvdcss) by the time honoured fashion of turning it off and on again. Could be worse I guess, CTRL-ALT-DEL is a lot kinder than 'ALT-SYSRQ-B', the long press of the power button or the dreaded unplugging. I guess in some ways it's a sign of acceptance that lo-tek housemates will try and fix things, and that they see it as a VCR. I wonder if there's a way to have a big red light that says 'recording' and another saying 'someone is using this over the network'. Maybe I should get an LCD that follows `who` and `mythtv-status.





Add new comment