I want to upgrade my production server OS
I have few VPS from The-Online.com as well as digitalocean and vultr. These VPS are actually production servers where active sites are hosted that earns money for me. I used debian and ubuntu OS on VPS but this OS are now quite old and need to upgrade them. Unfortunately the repo is not active anymore. Good to have OS updated from time to time. How do you safely upgrade to old debian or ubuntu OS on production server without breaking anything? Do I have to setup a new server / VPS with updated OS, and migrate everything there? Point DNS, and then remove the old server? Any other simple way?
Open SSH terminal and login. then type
sudo apt update
sudo apt full-upgrade
You can do that to upgrade to a newer OS via ssh. Create backups first. Packages installed will be upgraded to newer version.
Get a new VPS and migrate all sites and databases and set up DNS. there is more work doing this but it is safe way to upgrade OS. Since your OS is quite old don’t do apt full-upgrade as you’ve skipped many versions of the upgrade and it will certainly break the server. As always, first take server backup.
Get a new server or VP-S and use this script to auto-update the OS.
https://github.com/ENGINYRING/Linux-Auto-Update-Script
Just set it to run once per day OR once a week and it will keep your servers updated.
This script is quite helpful as it will abort the update/upgrade OS and send an email if potential errors are detected and/or if any package is being removed as result of the upgrade.
You really need to update OS more often. It doesn’t take long to apply updates and to reboot a server. I’m not saying you need to do it daily but something like weekly, monthly, or even quarterly is better than not doing it at all. It is a security risk to run old O-S and repo.