Upgrade to Debian 12 from Debian 11 Without Losting Data

Upgrade to Debian 12 from Debian 11 Without Losting Data

Hello friends, welcome to the inet70. Today, I can guide you on how to upgrade to Debian 12 (Bookworm) from the previous Debian operating system, Debian 11 (Bullseye), without losing your personal files and other important data. Now, we can start the upgrading process. Just follow all my easy steps to upgrade to a Debian 12 system.

First and foremost, you should adapt backup your Debian 11 system using Timeshift. This step is required because in case you lose all your files by getting some errors during the upgrading process, you can create one backup file of your Debian 11 system and save it on an external drive. After completing this step, follow the next step.

📝 Upgrade Debian

Our first step is completed. Now, we can follow the second step to update and upgrade all Debian packages. For updating and upgrading Debian packages, use the given command:

sudo apt-get update && sudo apt-get upgrade
sudo apt full-upgrade
sudo apt --purge autoremove

Put the two more commands for fully upgrading and autoremove in the command. After putting all the commands, now reboot your Debian system.

Edit Source List

This step is used to copy the sources.list file to the /opt/ directory from the /etc/apt. Follow the given command to copy the sources.list. This step is required for the upgrading process.

sudo cp /etc/apt/sources.list /opt/sources.list.bak
Copy Source list

It’s used for moving all source files, converting Bullseye to Bookworms. Put the following command to update all sourcelist data.

sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
Edit Source List

Here, we can convert the Bullseye packages to Bookworms and add the non-free-firmwares. Update the Ubuntu packages.

sudo apt update

After updating Ubuntu packages, we can start the upgrading process.

📝 Upgrade to Debian 12

This is the last step for upgrading to Debian 12 from Debian 11. This step takes about 10 minutes. Just follow the given command to start upgrading.

sudo apt full-upgrade
Debian Full Upgrade

After putting this command, press the enter key to show the asking for yes/no to press y to start the upgrading.

Package Upgrade Without Asking

In the current process, you may get asked, “Restart services during package upgrades without asking?” Now, select the “No” option as default and continue upgrading.

Here, I have successfully upgrade to Debian 12 system. I can check the current version of Debian 12 using the neofetch tool. If you get any type of error during the upgrading process, you can comment now on this post. I can fix your problem.