Migrating from 20.04 -> 22.04 -> 24.04 on headless Ubuntu server + hardware upgrade

Jeffrey Walton noloader at gmail.com
Sat Dec 7 22:46:25 UTC 2024


On Sat, Dec 7, 2024 at 5:29 PM Bo Berglund <bo.berglund at gmail.com> wrote:
>
> So I have this old server system which still runs Ubuntu 20.04.6 LTS server on a
> Lenovo Ideacenter minitower and I want to do these things:
>
> 1) Make it use the latest kernel for that Ubuntu version.
> For some reason it is stuck at Kernel 5.4.0-89.100-generic even though several
> later ones have been provided by the apt system. But it has not switched kkernel
> even though I have restarted it several times.
>
> $ uname -r
> 5.4.0-89-generic
>
> $ dpkg --list 'linux-image*' | grep ^ii
> ii linux-image-5.15.0-126-generic  5.15.0-126.136~20.04.1 amd64 Signed kernel
> image generic
> ii linux-image-5.4.0-200-generic   5.4.0-200.220          amd64 Signed kernel
> image generic
> ii linux-image-5.4.0-89-generic    5.4.0-89.100           amd64 Signed kernel
> image generic
> ii linux-image-generic             5.4.0.200.196          amd64 Generic Linux
> kernel image
> ii linux-image-generic-hwe-20.04   5.15.0.126.136~20.04.1 amd64 Generic Linux
> kernel image
>
> I believe I will not get the offer to do a release upgrade unless I can make it
> use a later kernel.

Hmmm... I don't think you need to run a HWE kernel to perform the migration.

> This server is "mission-critical" so I cannot make a mistake in the upgrade
> process, I need a full disk backup before I even embark on this, but the problem
> is how to do that.

I would back up the critical application data. You can always stand up
a new server right now with the NUC, configure it and load the data.
If you make a mistake, then no harm. Do it again with a modified
process. Once the NUC is setup properly, cut it into production.

> I probably have to boot into a usb system with GParted to do the disk partition
> copies....
>
> 2) Upgrade it to 22.04 and then to 24.04 using the do-release-upgrade command
> Once I have the backup done as above and somehow can make it use the latest
> kernel, then I want to do the transfer to 24.22.4 via 22.04.4

One caveat that comes to mind since the machine is mission critical...
If you migrate to 24.04, then you will have to deal with Snaps. I
avoided 24.04 precisely due to Snap, and migrated my machines to
Debian and Fedora instead.

> If that fails for some reason I need to bring back the original disk content to
> the drive (probably only the partitions used by 20.04.6, there are also a
> windows set of partitions, but that and the data partitions will not have
> changed.

Don't experiment on the production hardware. Leave it as it is. Work on the NUC.

> 3) Finally I want to move the entire system to a new ASUS NUC 13 i7 device to
> get rid of the Windows dependency of the Lenovo I am now using.

Yeah! I really enjoy blowing out Windows that came preinstalled a machine.

> Question:
> Can I just copy the final partitions of the converted Ubuntu to the drive in the
> NUC and start it to make it run my old server system?

Maybe, but the details can be tricky. Especially if the file systems
are different. And don't forget about MBR vs GPT. It is probably
easier to move the application data to a properly configured new
server.

> Or else - how can I make the move to new hardware?

Just move the application data to a properly configured new server.

> I cannot install a fresh system on the NUC because I have no idea how to then
> install all of the already configured services on the new hardware platform
> fresh from start...
>
> I simply do not now remember what I have done over the years to
> install/configure these since 2017 when it was originally built...

Yeah, I know the feeling. I usually find my notes are incomplete, and
have to solve some of the problems all over again.

> Or can a switch of hardware not be done?

Hogwash!

Jeff




More information about the ubuntu-users mailing list