[mythtv-users] Another "moving backend / restoring database" thread

Michael T. Dean mtdean at thirdcontact.com
Fri Feb 19 01:28:30 UTC 2010

On 02/18/2010 07:36 PM, Jon Whitear wrote:
> Hello folks,
> I'm in the process of changing my backend from a physical server running Gentoo to a virtual server running Mythbuntu. Both are running current 0.22-fixes. The Mythbuntu box is a new install of 9.10. The Gentoo box has been running since about 0.13; when I upgraded it from 0.21 to 0.22 I followed the instructions about corrupted databases (given that my Gentoo install us UTF8) but it seems from the output below that I still have a UTF8 database.

Yeah, that's fine after the upgrade to 0.22 completes.  It's 0.21-fixes 
and below that required a specific configuration of the database.

> The Gentoo box has a PCI DVB-T card, while I've bought an HD Homerun for use on the virtual. I have configured the virtual with the new tuners, a source, and the shepherd grabber to test that it all works. It does.
> What I would like to do, given that the new box is essentially up and running with a clean database and already configured with  tuners and listings, is simply 'move' my recordings from the old box to the new. However, the documentation advises that a full restore (with a name change) should be my preferred path.
> Here's my plan of action:-
> 1) Stop both mythbackends
> 2) Backup both databases (old and new.)
> 3) Unmount my recordings partition on my old backend (/var/media)
> 4) Drop the database on the new backend: mysql -uroot -p -e 'DROP DATABASE IF EXISTS mythconverg;'
> 5) Create a new database on the new backend: mysql -uroot -p<  database/mc.sql
> 6) Reset the MySQL mythtv user's password to that configured by Mythbuntu in /etc/mythtv/mysql.txt
> 7) Restore the old database to the new box:- mythconverg_restore.pl
> 8) Change the hostname in the new database:- mythconverg_restore.pl --change_hostname --old_hostname="XXXX" --new_hostname="YYYY"
> 9) Mount my recordings partition on my new backend (/var/lib/mythtv)
> 10) Run mythtv-setup on the new backend to reset (e.g. recordings) locations, delete and recreate tuners, delete and rescan channels
> 11) Start mythbackend on new box
> 12) Re-run my grabber (shepherd) and reconfigure it.
> Does this plan sound correct? Am I likely to carry over any character set problems? Anything I've missed?

Not sure.  The "both databases" part seems to imply something is wrong.  
You can't merge 2 databases, so you could only use one of them.

If your old host is currently connected into the system with the old 
host as a remote backend and you're trying to just change the host name 
for the recordings from the old host to the new host, the change 
hostname won't work--since the --new_hostname has already been used in 
the system.

That said, from reading the above steps, everything seems correct if you 
plan to a) throw away the "new" database backup that you're making in 
step 2 (i.e. you're just doing it "in case" or whatever) and b) the 
--new_hostname you use will be a hostname that's never been used before 
on the system with the database you're restoring (the "old" database).


More information about the mythtv-users mailing list