Back up important data before repartitioning, encrypting disks, or restoring backups. Wrong commands can destroy partitions or overwrite live files.
What you will achieve
Move to a new distro without losing data — backup, separate /home, and a checklist so you are not surprised by different package names or init quirks.
1) Back up before anything else
sudo rsync -aAXHv --exclude={/dev,/proc,/sys,/tmp,/run,/mnt,/media,/lost+found} / /mnt/backup/root/
rsync -aHv /home/ /mnt/backup/home/
Or use Restic/Timeshift — see related backup guides.
2) Preserve /home across reinstall
If /home is on its own partition, install the new distro and mount existing /home without formatting. User IDs should match — note id username before switching.
3) Export package lists (reference only)
# Debian/Ubuntu
dpkg --get-selections > ~/pkg-selections.txt
apt-mark showmanual > ~/manual-packages.txt
# Fedora
dnf repoquery --installed > ~/installed-packages.txt
Package names differ between distros — treat lists as notes, not a restore script.
4) Reinstall dotfiles selectively
Copy back .ssh, project dirs, and configs — avoid blind cp -a ~/.* which drags stale DE settings into a new environment.
Verify
Log in, confirm df -h /home, SSH keys work, and critical apps run under the new package manager.
5) Browser and app profiles
Firefox and Chromium profiles can be copied, but extensions may break across major versions. Export bookmarks via browser sync rather than raw profile dirs when possible.
6) SSH and GPG keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
gpg --export-secret-keys -a > ~/secret-keys.asc
Store GPG export encrypted offline. Never copy secret-keys.asc to cloud unencrypted.
7) Dual-boot vs replace
Switching distros on a dual-boot machine can reuse the Linux partition — format only the old root, keep /home and ESP. Document Windows boot repair USB location before touching partitions.
Post-switch checklist
- Reinstall GPU drivers if needed (NVIDIA proprietary differs between Debian and Fedora).
- Re-create systemd services and cron jobs — they do not migrate automatically.
- Re-import VPN and Wi‑Fi profiles; NetworkManager stores them in
/etc/NetworkManager/system-connections/.
8) Printer and firmware blobs
CUPS configs in /etc/cups may not transfer — re-add printers. Firmware for Wi‑Fi/BT often needs distro-specific packages after switch.
Prerequisites
External backup drive with verified rsync or Restic snapshot. List of proprietary apps (Zoom, Teams, GPU drivers) that may lack packages on target distro. Account credentials for mail and 2FA devices independent of OS.
Test live session first
Boot target distro live USB and verify Wi‑Fi, GPU, and sleep work on your hardware before wiping current install — saves tears when NVIDIA or Broadcom chips lack firmware on new distro.