(should work for any upgrade if you update release names)
Prep
sudo apt-get update
sudo apt-get upgrade
sudo apt-get full-upgrade
# Update the 2 individual files yourself, or run this:
sudo sed -i -e 's/bullseye/bookworm/g' /etc/apt/sources.list /etc/apt/sources.list.d/raspi.list
sudo apt-get clean
sudo apt-get update
Upgrade
"Interrupting this step after downloading has completed is an excellent way to stress-test your backups"
sudo apt-get upgrade
sudo apt-get full-upgrade
Cleanup
sudo apt-get autoremove
sudo reboot
Check Version
lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
I have seen many articles that give various commands that do not follow the official way.
This is the proper way and is mostly taken from: https://wiki.debian.org/DebianUpgrade