Updating from Ubuntu 20.04 to 22.04 questions
I'm looking at moving from Ubuntu 20.04 LTS to the newer 22.04 LTS.
Two questions:
It looks like I can spin up a new 22.04 Linode from a Linode backup of my current server. Won't that bring a lot of old stuff (often called cruft) from the current system? Is it advisable to do this?
If I start a fresh server without the backup, can I copy the Apache2 virtual folders over to the new system our should I build them all over again? (With 10 domains this will take some time.)
3 Replies
- It looks like I can spin up a new 22.04 Linode from a Linode backup of my current server. Won't that bring a lot of old stuff (often called cruft) from the current system? Is it advisable to do this?
You could spin up a new 20.04 Linode from a backup and upgrade it. That should get rid of the cruft. As long as you disconnect from your PPAs and follow all the Canonical rules, you should be fine. If it fails, all you're out is a few cents worth of wasted service.
If everything works out fine, just swap the IP addresses.
- If I start a fresh server without the backup, can I copy the Apache2 virtual folders over to the new system our should I build them all over again? (With 10 domains this will take some time.)
If I was going to put in this much work I'd migrate off of Ubuntu and onto Debian (or, better yet, Devuan or FreeBSD…since both are free of the tentacles of that bane of human existence: systemd). YMMV…
-- sw
disconnect from your PPAs and follow all the Canonical rules
What are the Canonical rules?
I don't understand. Isn't a Linode backup a mirror of the disk? So if I spun up a new Linode from the backup would I not get a lot of junk from 20.04 that would not be needed in 22.04 when I did the upgrade via
sudo do-release-upgrade
Or does the do-release-upgrade command wipe out just the OS stuff and leaves my data? (Apache virtual hosts, website code, database (Espocrm) pix gallery (Piwigo) etc.?
If everything works out fine, just swap the IP addresses.
Well nothing is going to work OK because the new Linode (from the Backup) will have a new IP and I'll have to change all the DNS records for the new IP. What good is the IP swap?
With virtual hosts, trying to hit a new website with just the IP will just give you whatever one Apache defaults to… unless there is some code one can put in the virtual host file to make it default… and then just change that for each new domain?
It sounds to me that the very best way to upgrade is to just 'gut it out' and spin up a virgin 22.04 Ubuntu Linode, lock it down, copy over the Apache2 v.h. files, do the commands to enable them and then change one IP at a time in the DNS A record… for each domain to test it.
[Sounds like a PITA… maybe I'll just wait a year when I get closer to end-of-support!] :-)
What are the Canonical rules?
Those unwritten things that no software vendor tells you about…
Or does the do-release-upgrade command wipe out just the OS stuff and leaves my data? (Apache virtual hosts, website code, database (Espocrm) pix gallery (Piwigo) etc.?
It will upgrade the kernel and all the installed packages current for the release you're upgrading to. This is why you have to disconnect from PPAs first. The new-release packages may obviate the need for PPAs (i.e., PHP 8.x).
Well nothing is going to work OK because the new Linode (from the Backup) will have a new IP and I'll have to change all the DNS records for the new IP. What good is the IP swap?
Well, after you get done, you'll have 2 Linodes -- your original 20.04 one and your new one with 22.04 (and all your apps/configs/etc upgraded). After some amount of testing to make sure the 22.04 one is ok, you go to the cloud manager and tell it to swap the IP(v4) addresses of the two Linodes. The result will be that the 22.04 Linode will have the 20.04s IPv4 addresses.
Ergo, unless you use IPv6, you won't have to change DNS. If you do use IPv6, you'll have to change those manually (this is because of the way IPv6 addresses are assigned…very different than IPv4)…but you'll only have half the work and you won't have to wait for any IPv4 changes to propagate.
After all that's done, you delete your 20.04 Linode (that has the IP addresses that are not in your DNS config).
-- sw