Upgrade time can be a daunting time specially if you are new or not that confident in performing upgrades, I will be covering the basics of upgrading which will allow you to perform an upgrade of your Debian 11 to a Debian 12 system.
The first thing that you want to do before making any changes is make sure you are familiar with the server and it's primary function, for example is it a mail server, web server database server, file server etc... this will then enable you to test it's primary function once the upgrade has completed and spot any major problems that may crop up.
You will also want to ensure that you have a backup and that you are able to restore that backup in the event that it's required. If it's a virtual machine then take a snapshot if possible. You should also consider how you will access the machine if there are problems, do you have physical access or remote access via an IPKVM/IPMI the last thing you want is for the server to go down in a remote location and you can't get onto it or boot a live cd of some sort to try and fix it.
As a general rule of thumb, the less additional or 3rd party software installed on your system, the higher chance for a successful upgrade, if you have installed any 3rd party software or manually installed software then you should check if this will upgrade with the rest of the system, in some cases you may need to remove the software prior to performing the upgrade.
Before starting the upgrade to Debian 12 you will need to ensure that your system is fully up-to-date
Checks for partially installed, missing and obsolete packages.
Check what packages are held back if any.
Before proceeding make sure you don't have any issues with packages or packages on hold.
The system should now be fully updated with no issues with packages so we can now update the sources.list file with the Debian Stretch sources.
Make a backup the current /etc/apt/sources.list
cp /etc/apt/sources.list /etc/apt/sources.list_backup_`date +%Y-%m-%d_%H-%M`
Edit your sources.list file and update the keyword
deb http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main
deb http://deb.debian.org/debian-security/ bullseye-security main
deb-src http://deb.debian.org/debian-security/ bullseye-security main
deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.debian.org/debian bullseye-updates main
deb http://deb.debian.org/debian bookworm main
deb-src http://deb.debian.org/debian bookworm main
deb http://deb.debian.org/debian-security/ bookworm-security main
deb-src http://deb.debian.org/debian-security/ bookworm-security main
deb http://deb.debian.org/debian bookworm-updates main
deb-src http://deb.debian.org/debian bookworm-updates main
or if you are feeling lazy you can use
sed to update your sources lists
sed -i'.bak' 's/bullseye/bookworm/g' /etc/apt/sources.list
If you have other repos that need updating then you can do them.
When upgrading the system will prompt for user input so be aware of this so don't issue the command and run!! After the sources are updated you will need to update the packages list then start the upgrade process
After the updates have completed reboot the server and then check reported version and services
To clean up any old files you can run
apt --purge autoremove which will clean up any old packages.
apt --purge autoremove
You should now have your system fully upgraded to Debian 12 Bullseye.