Upgrade from Debian 11 to 12
Update the existing system first
apt update
apt dist-upgrade
Swap Bullseye (11) for Bookworm (12) in the repositories
sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
Start the upgrade
apt update
apt dist-upgrade
If all went ok, restart the system
You should then be in Debian 12 Bookworm