[mythtv-users] Please help me move my backend to new host/hardware.

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Mar 24 17:01:23 UTC 2023


On Fri, 24 Mar 2023 10:26:07 -0500, you wrote:

>All,
>
>  I have a mythtv setup with one backend and several frontends. The 
>backend machine also runs a frontend to test any issues locally. They 
>all run some version of debian with mythtv packages installed over 
>standard release. Currently they all are on debian bullseye with 
>possibily running more recent kernels due to the need to support more 
>modern processors. My tuners are HDhomerun networked on the same subnet. 
>There are two - one 2-tuner and another 4-tuner with static IP 
>assignment from my  home DHCP server. My current backend is also on a 
>static IP assignment. Other frontends are on dynamic assignment.
>
>   However, my backend is old (10+ years) and in need of HW upgrade. 
>Towards this, I have built a new machine with intel z690 MB and a core 
>i3-13100. I installed debian testing and ran a complete check to make 
>sure key hardware components work as expected. I also checked kernel 
>5.19 supports all that care about in my new machine. I am at a point to 
>move my backend SW setup to this machine. To support this I have a new 
>and unused partition of correct size in the new machine's disk. Both 
>current and new hardware use UEFI boot and I do not have any legacy BIOS 
>boot in any of my home machines.
>
>  My plan is to make image copy of the current installation, restore on 
>the partition created for this purpose and set it up.
>Let us call the test installation (debian testing to check the hardware) 
>as _new-base_ and backend image copy restored on new hardware as 
>_new-backend_. We will use _current-backend_ to refer to the system that 
>is currently running and serving from the older hardware that I want to 
>replace.  I plan to proceed this way and please let me know if I am 
>making any mistakes. (These steps are inspired by this: 
>https://www.mythtv.org/wiki/Backend_migration)
>

Make sure the new system has the correct packages installed for the
filesystem you are using on your recording drives, if it is not ext4.
I always manage to forget to install JFS on my new systems.

> 1. Shut down all frontends
> 2. On the current-backend, make a fresh db backup and disable backend
>    service (systemctl disable mythtv-backend)

Shut down and disable mythbackend before making the database backup:

systemctl --now disable mythtv-backend

> 3. Reboot current-backend machine using some rescue boot usb and make
>    image copy of the current install on to a spare disk. Shutdown the
>    backend machine completely and do not boot it at all again.

If you have enough space on one of your recording drives, just use a
bootable clonezilla image to create the boot drive image on one of
them.  Then move that drive to the new PC and boot clonezilla there
and restore the image.  Clonezilla normally copies the UUID values of
the original partitions - other backup software often will be
"helpful" and give you new UUIDs.

Clonezilla can also do image backups over your network to other
systems, but that is rather slower than doing it directly to a drive.

If the new system partition is larger than the old one, I am not sure
if clonezilla has an option to expand the system image to fill the new
partition when it does the restore.  If it does not, just run gparted
and do that.  Make sure the new system partition is not exactly the
same size as the old one, as that usually means the restore will fail
because the partition is too small, due to the change in size of
blocks and disk layout.  If you want close to the same size, just make
it a little bit bigger than the old one.

> 4. Boot new-backend hardware, bootup new-base installation, image
>    restore backend on to its designated partition
> 5. Fsck this restore to make sure everything is ok, mount it, fix
>    fstab, hostname and few other essential items in the restore image.
>    Also make sure using symlinks storage directories now point to local
>    disk.
> 6. Run update-grub on new-base install so that new-backend image
>    becomes a choice up on grub prompt on a reboot.
> 7. Reboot the image copy (new-backend) update-grub and update-initramfs
>    -u and reboot back into new-backend
> 8. Since backend.service was disabled before image copy, note backend
>    is running yet. Run mythtv-setup and fix master-backend name and IP
>    and any  other essential items.

If the new backend has a different hostname, then run
mythconverg_restore.pl with its option to change the hostname in the
database.

> 9. Transfer storage drives from current-backend machine to new-backend
>    drive and make sure symlinks made in step 5 are adjusted to point to
>    correct directories.
>10. After double checking, enable backend-service and start it. Go to a
>    nonfrontend host, pull up mythweb and check that you can
>    connect/view the status on the new-backend. Ensure all tuners are
>    visible and you can see the listing.
>11. Add a recording to see if things work as expected.
>12. Start the frontend on new-backend machine enter setup and point it
>    to new-backend. Watch live-tv and pull up the new recording made to
>    check everything is ok
>13. Review status of backend recordings/rules etc to make sure
>    everything is in order.
>14. Boot up other frontends and point to the new-backend and test it.
>15. Wait a week for this new setup to work as expected and then
>    permanently wipe the current-backend install so that it can never be
>    booted to cause any confusion.
>
>Please let me know if I missed any step.
>
>Since I used UUID for all mounting (or partition reference), I chose 
>image copy/restore instead of tar to create and restore the 
>installation. Let me know if you think that is a bad choice also.
>
>Regards
>Ramesh

If you have not met it yet, the best way to make bootable images on
USB sticks is to use Ventoy, which allows you to have many different
bootable images on one USB:

https://ventoy.net

Once you have Ventoy installed, all you have to do to add a new Linux
image is to copy the live image .iso file onto the USB.  I always have
copies of the live images of my distros, a clonezilla image and my
current Windows install image on my Ventoy USB.


More information about the mythtv-users mailing list