Upgrade to Debian 12 from Debian 11

Make sure that current Debian 11 is up to date with all packages:

sudo apt update
sudo apt upgrade
sudo apt full-upgrade
sudo apt autoremove --purge
sudo systemctl reboot
Verify the status before upgrade:
uname -a
cat /etc/debian_version
Move old APT source file to aother location:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
You need to update the /etc/apt/sources.list file by substituting every instance of bullseye with bookworm:
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
Or alternatively, edit new /etc/apt/sources.list file and add the Debian 12 bookworm entries like below, you can remove everything and add those:
deb http://deb.debian.org/debian/ bookworm main
deb-src http://deb.debian.org/debian/ bookworm main

deb http://security.debian.org/debian-security bookworm-security main
deb-src http://security.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

deb http://deb.debian.org/debian bookworm non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm non-free non-free-firmware

deb http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware
deb-src http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware

deb http://deb.debian.org/debian bookworm-updates non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates non-free non-free-firmware
Finally, upgrade to Debian 12:
sudo apt update
sudo apt full-upgrade
After the upgrade is complete, reboot:
sudo systemctl reboot
Check again the system status:
uname -a
cat /etc/debian_version
Cleanup:
sudo apt autoremove --purge