Debian 12 got released on June 10th 2023, it uses kernel 6.1, and it comes with a lot of new features. One thing that I liked in this new version, is that now Debian 12 comes with multiple Desktop environments that you can use, such as :GNOME, KDE, XFCE,MATE,LXDE and LXQt.
In this tutorial, you will learn how to upgrade debian 11 to debian 12. You can download and use Debian 12. However, you don't have to do a full installation in order to use debian 12, as you can upgrade your existing installation to debian 12.
Follow the steps in this tutorial, to upgrade Debian 11 "Bullseye" to Debian 12 "Bookworm"
Step 1 - Backup your system
You need to backup your data to be safe just in case something goes wrong. Even though this is an upgrade and not a full installation, you still need to save a copy of your data, if you use multiple partitions on your system, I'd recommend you transfer all your data to a secondary partition and don't leave them on the partition where the system is.
If you have only one partition on your system, the best thing to do in this case is to copy all your files to an external device, for example into a portable hdd or flash drive.
Step 2 - Update your system
Before starting the upgrade, update your system to ensure that there are no unupdated packages on your system. Run the command below to perform a system update
sudo apt update && sudo upgrade -y
The command above will check for update, and if there are packages to be updated, it will update them. This step is necessary so you don't have any old packages before upgrading your system
Once the packages are updated, you also need to remove the unused packages from your system, in order to avoid any conflicting with debian 12.
To remove the unused packages, run the command below
sudo apt --purge autoremove
Step 3 - Configure sources.list
Once you have updated your system, now you need to configure the sources.list. To do this, you basically need to replace every word "bullseye" with "bookworm".
Bullseye is the codename for the debian 11, in this tutorial we are going to upgrade debian 11 "Bullseye" to Debian 12 "Bookworm", so you need to open first the sources.list file with a text editor and then replace all words "bullseye" to "bookworm"
The sources.list file is located on /etc/apt
To open sources.list with a text editor run the command below
sudo nano /etc/apt/sources.list
This is how the sources.list file should look like before configuring

Now update all words "bullseye" with "bookworm", and the sources.list should look like this

- Delete the old source.list
sudo rm /etc/apt/sources.list
2. Create source.list file again
sudo nano /etc/apt/sources.list
3. Copy the config below and paste it to the new source.list
deb http://deb.debian.org/debian/ bookworm main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main non-free
deb-src http://security.debian.org/debian-security bookworm-security main non-free
deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware

4. Save the new config of sources.list file by pressing CTRL + X, and confirm by pressing the Y key.
Now sources.list should be ready to use.
Step 3 - Update your system
Now you need to update your system to make sure that the new config of sources.list is configured correctly
sudo apt update
Once you run the command above, you should see the new sources that we configured earlier

As shown in the image above, there are 1280 packages that can be upgraded, this means we can proceed to upgrade Debian 11 to Debian 12.
Step 4 - Minimal Upgrade
Let's now start a minimal upgrade of Debian 11 to Debian 12
sudo apt upgrade --without-new-pkgs
Once you run the upgrade command, you should see this prompt on your terminal

press Y to continue the upgrade.
Next, you should see the following prompt, on this step you need press q
to quit this window, and continue the minimal upgrading.

Select Yes, on "Configuring libc:amd64" prompt, and press enter

and you should see this output on the terminal

Step 5 - Perform a full upgrade
Once the minimal upgrade has been completed, you can now continue to do a full upgrade. This command will upgrade Debian 11 "Bullseye" to Debian 12 "Bookworm", run the command below to continue
sudo apt full-upgrade
On "Configuration file /etc/sudoers" prompt, you need to press enter and go with the default option, to keep the current sudoers file. Sudoers file is the file that contains user permissions config, so make sure to not rewrite this file as it can break your system.

Now, all you have to do is to wait for the upgrade to complete. Make sure to not close the terminal during the upgrade.
The upgrade will be completed, once the progress bar shows 100% on your terminal.
Step 6 - Reboot
Once the full upgrade is completed, now you need to reboot so you can start using Debian 12.
sudo reboot
Step 7 - Verify the upgrade
To verify that the upgrade got successfully completed, and that now you are using Debian 12 "Bookworm", you can run the lsb_release
command to view the details about your distro
lsb_release -a
Output
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codenme: bookworm
Step 8 - Use Debian 12 "Bookworm"
On the login screen, you can also choose the desktop environment that you want to use. Simply click over the switch button, and choose your preferred desktop environment.
Debian 12 supports multiple DE, so you can choose any of the supported desktop environments.

Once you select Desktop environment, login so you can use it.
Conclusion
In this tutorial, you learned how to do a minimal and full upgrade of Debian 11 "Bullseye" to Debian 12 "Bookworm".