I have a Pi Zero W that runs headless as an SSH gateway here. It auto connects to the Wifi and lets me SSH in to the home network etc. It's more than up to the job in hand and uses barely any electricity so can stay on 24/7.
It was running Debian 10 (or whatever the Pi version of that was called Raspbian??) and I wanted to move to Debian 11 (PiOS ??). The preferred way is to download the latest image and install that but that would be a pain as there's lots of customisation been done. As I've successfully updated 3 systems from 10 to 11 in situ so I thought I'd try it on the Pi. It works like a dream (a bit slow) apart from one showstopper that is easily fixed. The system has a very lightweight image, I'm not sure now but think it was 2021-01-11-raspios-buster-armhf-lite.img originally. SDcard was 8GB with about 5GB free.
Anyway having backed up the SDcard image...
sudo -s apt update apt upgrade apt full-upgrade apt --purge autoremove reboot
When it reboots and you have logged in again...
sudo -s
Edit sources.list etc. in /etc/apt/* and change all the occurrences of "buster" to "bullseye". There's a few files that need updating.
apt update apt upgrade --without-new-pkgs apt full-upgrade apt --purge autoremove
Allow 30-45mins for the above. Depends on how big your installation was and how fast the SDcard is.
At this point you would reboot and enjoy the fruits of your labours. But you'll find deep sadness if you do. The upgrade borks dhcpcd5 and you have no DHCP client so there is no networking. I couldn't SSH in :-( Of course this is a real pain on a headless machine. I don't have a serial console for this Pi Zero W so I put the card in a Pi A+ that does and I could see the SDcard booted to a login prompt. My account and password was there and the config files looked OK. I had a cup of tea and realised I had a Mini HDMI to HDMI adapter and watching the boot messages I could see DHCP errors. A bit of Googling found
ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w to ExecStart=/usr/sbin/dhcpcd -q -w
Rebooting after you have done this and the system will come up all fine and dandy. Of course I had to fanny about to find this out and edit the file on another system. If it wasn't for this then the upgrade process, whilst a bit slow, would be as painless as it is on other Debian derived systems.
Info on this is out there. I'm hoping this might be useful to someone who wants to do this and doesn't want to have to fix it afterwards ;-)
Andy
YMMV