Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Switch Linux Distros Without Losing Data

· 6 min read · Smart Home

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can switch Linux distributions and keep all your files, settings, and installed programs. The key is to back up your data and configuration files, then restore them after installing the new distro. This guide walks you through the process, covering both home directory backups and package lists, so you can migrate with minimal disruption.

What You'll Need

  • An external drive or USB stick with enough space for your data (check your home folder size first).
  • A USB drive (at least 4GB) to create the new distro's live installer.
  • A computer with internet access to download the new ISO and any tools.
  • Time: the whole process can take a few hours depending on data size and internet speed.

Step-by-Step

  1. Back up your home directory. The simplest method is to copy your entire home folder (which contains documents, pictures, music, and most app settings) to an external drive. Open a terminal and run:
    rsync -aAXv --exclude="/home/you/.cache" /home/you/ /media/you/backup/home/
    Replace you with your username and /media/you/backup with the mount point of your external drive. This preserves permissions and symlinks. If you don't have rsync, use cp -a instead.
  2. List your installed packages. On Debian/Ubuntu-based systems (like Mint, Pop!_OS), run:
    dpkg --get-selections > packages.txt
    On Fedora/RHEL-based systems, use:
    dnf list installed > packages.txt
    On Arch-based systems, use:
    pacman -Qqe > packages.txt
    Save this file to your external drive along with the home backup.
  3. Note your manually added repositories. If you added PPAs or third-party repos, write them down or save the list. For Debian/Ubuntu, check /etc/apt/sources.list and files in /etc/apt/sources.list.d/. For Fedora, check /etc/yum.repos.d/. You'll need to re-add these after the new install.
  4. Create a live USB of the new distro. Download the ISO from the official website of your chosen distro. Use a tool like balenaEtcher (available for Linux) or dd in the terminal to write the ISO to a USB drive. This will erase the USB, so use a blank one.
  5. Boot from the live USB. Restart your computer and enter the boot menu (often F12, F2, or Esc during startup). Select the USB drive. You'll get a live environment where you can test the distro before installing.
  6. Install the new distro. Run the installer from the live environment. When you reach the partitioning step, choose "Erase disk and install" if you want a clean slate, or "Something else" if you want to keep separate partitions. Warning: This will wipe your old system, so make sure your backup is complete before proceeding.
  7. Restore your home directory. After the installation is complete and you've rebooted into your new system, connect your external drive. Copy your backed-up home folder back to your new home directory. For example:
    rsync -aAXv /media/you/backup/home/ /home/you/
    If you used a different username, you may need to adjust ownership with chown -R you:you /home/you.
  8. Reinstall your packages. On Debian/Ubuntu, run:
    sudo apt update && sudo apt install $(cat packages.txt)
    On Fedora, use sudo dnf install $(cat packages.txt). On Arch, use sudo pacman -S $(cat packages.txt). This will install the same programs you had before, but note that some may have different versions or may not be available in the new distro's repositories.
  9. Re-add your repositories. If you saved a list of PPAs or third-party repos, add them again using the appropriate commands (e.g., add-apt-repository for Ubuntu). Then run sudo apt update again.
  10. Restore configuration files. Most of your app settings are in your home folder (in hidden files and folders like .config, .bashrc, .ssh). Since you restored the entire home directory, these are already in place. Just log out and back in to ensure they load.
  11. Check for missing drivers or firmware. After installation, run sudo ubuntu-drivers autoinstall (Ubuntu) or use the "Additional Drivers" tool in settings. For other distros, check the hardware support documentation.

Common Mistakes

  • Not backing up hidden files. Many settings live in dotfiles (e.g., .bashrc, .config). A simple file manager copy might miss them if you don't show hidden files.
  • Forgetting to save the package list. Without it, you'll have to manually reinstall each program, which is tedious.
  • Using a different username. If your new username differs, file ownership will be wrong. You can fix with chown, but it's easier to use the same username.
  • Installing over the old system without verifying the backup. Always test that your backup is readable before wiping the drive.
  • Assuming all packages are available. Some distros have different package managers and repositories. Your old packages might not exist or might have different names.

Tips

  • Use a backup tool like Deja Dup or Timeshift for a more automated approach, but the manual rsync method is reliable.
  • If you have a lot of data, consider using an external SSD for faster backup/restore.
  • Keep a list of your manually edited configuration files (like /etc/fstab, /etc/samba/smb.conf) outside your home folder. You'll need to reapply those changes manually.
  • Before switching, spend some time in the live environment to ensure your hardware (Wi-Fi, graphics, sound) works out of the box.
  • If you're moving between distros with different init systems (e.g., from systemd to OpenRC), some services may need reconfiguration.

Troubleshooting

If the new system doesn't boot after installation: Check your BIOS/UEFI settings to ensure the correct boot device is selected. If you used a separate /boot partition, make sure it's mounted correctly. You can boot from the live USB and use boot-repair (available on Ubuntu) to fix GRUB.

If your Wi-Fi doesn't work: Install the appropriate firmware. On Ubuntu, run sudo apt install linux-firmware. On Fedora, enable the RPM Fusion repository and install kernel-firmware. For some Intel or Broadcom cards, you may need to download proprietary drivers from the hardware vendor.

If your restored settings cause crashes: Some old configuration files may be incompatible with newer software versions. Try moving the problematic config folder (e.g., ~/.config/oldapp) to a backup location and let the app recreate defaults.

If the package list fails to install: Some packages may have been removed from the repositories. Edit the packages.txt file to remove lines that cause errors, then run the install command again.

If your home directory permissions are wrong: Run sudo chown -R yourusername:yourusername /home/yourusername to fix ownership.

If you forgot to back up before installing: Stop immediately. If you haven't written to the old drive yet, you might be able to recover data with tools like testdisk or photorec from a live USB. But this is risky and not guaranteed. Always back up first.

Frequently Asked Questions

Can I keep my installed applications when switching distros?

Not directly. You can reinstall them from your package list, but some apps may have different versions or dependencies. Flatpak and Snap apps can be exported and reinstalled more easily.

Will my files in /home be preserved if I keep the same partition?

If you choose "Something else" during installation and mount your existing /home partition without formatting it, your files will remain. However, it's still wise to back up, as a mistake could wipe the partition.

What about my desktop environment settings?

Most desktop environments (GNOME, KDE, XFCE) store settings in your home folder, so they'll be restored with your backup. However, if you switch to a different DE, some settings may not apply.

Is it better to do a clean install or upgrade in place?

For switching distros, a clean install is recommended because it avoids conflicts between old and new system files. In-place upgrades are only possible within the same distro family and can be risky.

How long does the whole process take?

It depends on your data size and internet speed. Backing up and restoring can take 30 minutes to a few hours. The installation itself is usually 20-40 minutes. Reinstalling packages can take another 30-60 minutes.

Can I switch to a distro with a different package manager?

Yes, but you'll need to manually reinstall software using the new package manager. The package list from your old distro won't be directly usable, but you can use it as a checklist.