Raspberry Pi OS Trixie Migration Guide: Safe Upgrade from Bookworm¶
Raspberry Pi OS Trixie is the current major Raspberry Pi OS release. A major OS upgrade is a good time to remove configuration drift, but it can interrupt a home server if Docker volumes, SSH keys, or systemd services are left behind.
This guide uses the safe route: inventory the old Bookworm installation, back up the data that matters, install a fresh Trixie image, and restore services one at a time. Raspberry Pi recommends a new image rather than an in-place major-version upgrade.
What to plan for¶
Use this guide on Raspberry Pi 4, Raspberry Pi 5, or a compatible Compute Module. Do not overwrite the old boot disk until the new system has booted and your services have been tested. Keeping it unchanged is the simplest rollback plan.
- Desktop systems use Wayland by default; older X11-only remote-desktop workflows may need adjustment.
- Python applications should use a virtual environment instead of global
pipinstalls. - Camera commands are named
rpicam-*; legacyraspividandraspistillare unsupported. - Test unattended scripts that use
sudoafter the migration.
1. Inventory the old system¶
Connect by SSH or use a local terminal, then save an inventory outside the boot disk. Replace /media/backup with a mounted USB disk or network share.
For a Docker host, record containers, volumes, and Compose files:
The package list is a reference, not an instruction to reinstall everything. Reinstall only the applications you still need.
2. Back up configuration and data¶
Back up data deliberately. A copy of /etc is useful for comparison, but restoring it wholesale can overwrite Trixie defaults.
For a Docker Compose project, stop it briefly and archive its bind-mounted data. Database-backed services also need a logical export; a copy of a live database directory is not reliable.
Keep private keys and tokens only on an encrypted, physically controlled backup drive.
3. Install a clean Trixie image¶
- Use Raspberry Pi Imager to write current Raspberry Pi OS (64-bit) to a different disk where possible.
- In the Imager customisation screen, set a hostname, user, Wi-Fi settings if needed, and enable SSH.
- Boot the new disk and verify that SSH works before taking the old service offline.
- Update the new system:
For Pi 5 NVMe boot, verify firmware, boot order, HAT, and power supply with the NVMe boot guide. Do not copy the old /boot/firmware/config.txt without reviewing each setting.
4. Restore access first¶
Restore SSH public-key access before workloads. Copy only the required files, then confirm a second terminal can log in:
For remote administration, configure Tailscale or Raspberry Pi Connect after the base system is stable.
5. Rebuild Docker services¶
Restore each Compose project separately. This makes an image, port, or permission problem easy to isolate.
Restore database dumps only after their destination container is healthy. For related setups, see Docker Compose and Nginx Proxy Manager and the monitoring stack guide.
6. Recreate services, schedules, and Python environments¶
Compare old systemd units with the new defaults instead of copying all of /etc/systemd:
Confirm the service user, paths, environment files, and group permissions. The systemd daemon guide covers reliable units.
Recreate, rather than copy, virtual environments:
Final checklist¶
- SSH key login and local-console login work.
-
findmnt /shows the intended boot disk. - Docker data and database exports have been restored and tested.
- Enabled services and scheduled jobs survive a reboot.
- VPN, DNS, and remote-access services work from outside the LAN.
- The old disk remains untouched until several successful new backups complete.
A clean migration takes more care than an in-place upgrade, but leaves the Pi easier to maintain and recover.