[mythtv-users] Migrating backend to a new machine

Michael T. Dean mtdean at thirdcontact.com
Tue Dec 29 21:56:33 UTC 2009


On 12/29/2009 01:50 PM, Mitko Haralanov wrote:
> I am looking for advice on how to migrate my existing mythbackend to a
> new machine.
>
> Currently, I have a machine which is both a backend and a frontend and
> I want to migrate the backend part of it to a new more powerful
> machine.
> As of now, I am using 1 HDHR and 3 PVR250s in the current backend,
> however, only 2 of the PVRs are being moved (the third is being
> decommissioned).
> Both new and old backends are running the same software (Mythdora
> 10.21) with latest updates. Mythbackend is already installed on the new
> machine, however, it doesn't look like the black database has already
> been created.
>
> As far as I have read, what I will need to do is the following (in that
> order):
> 1. Back up the database from the old backend with mythconverg_backup.pl
>   

Yes, definitely.

> 2. Shut down mythtv-backend and mythtv-frontend so nothing changes the
> database while I am doing the move.
>   

Ideally, shut everything down before doing the backup, above.

> 3. Move the PVRs to the new machine
> 4. Copy my entire video directory with the current Storage Group
> directory structure
> 5. Run mythtv-setup on the new machine and setup the tuners and Storage
> Groups as they were on the old backend.
> 6. Restore the database from the latest backup using the
> --partial_restore and --with_plugin_data options.
>   

Don't do this.

> 7. Change the hostname of the backend in the database using
> mythconver_restore.pl --change_hostname --old_hostname=...
>   

Better approach below.

> Will the above procedure work in getting me to a working duplicate of
> the old backend? Is there anything that I am missing?

The best solution is to use the same hostname for the new backend that 
you used for the old backend and to use a new hostname for the 
frontend.  This way, /all/ of the mythtv configuration in your current 
database will apply to the "new" backend (with the same hostname) and 
you don't need to change the hostname in the database.  And--more 
importantly--all you need to do is configure the new frontend--which is 
/significantly/ easier to configure than configuring a backend 
(generally, configuring a frontend consists of going into 
Utilities/Setup|Setup|TV Setting|Playback and changing the playback 
profile group on page 3 from CPU+ to Slim and all the rest is 
preferences you can change whenever you want). 

If you can't change hostnames on the system, then change the hostname in 
the MythTV database after doing a *full restore* to get the same end 
result (fully-configured backend and only needing to configure the 
frontend).

With this approach, you would:

1) Shut down all mythfrontend processes and then remote mythbackend 
processes and then the master mythbackend process.
2) Back up the database on the old backend with mythconverg_backup.pl
3) Move the PVRs to the new machine
4) Copy the entire mythtv recordings directory structure to the new machine
5) Ensure that no mythtv applications are running on any machine (old or 
new)
6) Do a *full restore* of the backup from the old backend to the new 
backend ( 
http://www.mythtv.org/wiki/Database_Backup_and_Restore#Database_Restore 
), making sure to drop any existing database before hand (i.e. those 
installed by packages)
6) Change the hostname (see below)
7) Start MythTV programs and enjoy (it is critical that you do not start 
any MythTV programs on the system with the new hostname until you've 
done the hostname change)

As far as changing the hostname goes, you can either ensure your new 
backend system uses the same system hostname as your old backend system 
(which means ensuring you use a new hostname for your frontend system) 
or you can change the hostname in the database with:

http://www.mythtv.org/wiki/Database_Backup_and_Restore#Change_the_hostname_of_a_MythTV_frontend_or_backend

mythconverg_restore.pl --change_hostname \
  --old_hostname="XXXX" --new_hostname="YYYY"

as you had mentioned.  If you're doing a complete OS install on both 
machines, it's easiest to change the system hostnames as you install.  
If not, it's up to you which you change (the system hostnames or the 
hostname in the database).

However, regardless of whether you use the same system hostname for the 
backend (and a new system hostname for the frontend) or you change the 
hostname in the database, there's absolutely no reason to do a partial 
restore.  A partial restore would just cause a whole slew of extra work 
(and, likely, a whole slew of extra problems).

Mike


More information about the mythtv-users mailing list