Upgrading Debian 10 (Buster) to Debian 11 (Bullseye)
I am a big fan of Debian in the server environment, mainly due to its great record in stability, security and other important aspects like having a huge number of tutorials and guides available online. Since the release of Debian 11 (codenamed Bullseye), I've been thinking about upgrading to the latest version. I will start on one of my VPS servers to test how is everything working. There are number of tutorials online explaining the exact same thing. Feel free to follow which you find the best, this is mainly for my documentation.
Summary
- Backup your system – You never know what can go wrong, be prepared.
- Edit apt's sources.list – In order to fetch and intall packages meant for Debian 11, we need to change a some lines in the /etc/apt/sources.list file.
- Update software repos – Make apt aware of the changes you've made in sources.list and upgrade existing packages.
- Upgrade the system itself – After upgrading packages, you can upgrade the system as well.
Backup your system
Unless you actually have a testing environment, where loss of files won't cause even a minimal headache, please backup your data. In most cases, it is OK to at least backup all configuration files for any services running on the server. You can always rebuild the server using them in case something bad happens. Always have an presice upgrade plan when upgrading production servers, including plans B and C and D, depenging on the criticality of the service you are running. I am upgrading a server with two services only I use, so I can afford a very simple "backup" – cat all config files into terminal and copy them to notepad on my workstation, that's it. You can also setup something fancier like rsnapshot or restic.
Check system and update packages
There are numerous ways (from basic to most fancy) to check what version and distribution you are running, try running couple of these:
lsb_release -a
If you don't have that installed like me, try on of the other options. Simply cat /etc/debian_version
or /etc/os-release
$ cat /etc/debian_version
10.10