Guide for Moving to New Linux Distribution

by Stephen Fluin 2010.03.16

While Ubuntu updates usually work relatively well, maintaining settings, configurations, and upgrading packages to new versions. This is nice, but sometimes it's better to just install the new system from scratch. This is always a tough decision because a balance needs to be struck between migrating files from the old system to the new one, and leaving things behind that you don't need or want anymore.

Deciding when to start fresh with a new distribution

In general, if you are happy with what you have, DON'T START FRESH! The only time you want to start fresh is when you have had your computer for a while and you are beginning to suspect things are getting a little bit dusty or more clogged than they should be. For me this meant that I had gone through 4 Ubuntu release upgrades, but I had also been dangerous and tried out some of the betas and alphas, which probably left a few files and configurations in places that I didn't even know about. For me this also meant that my grub install had never been upgraded, and my /etc/ folder was filled with settings and configurations from programs I hadn't used in years. These things don't typically have a huge impact, but to me having as few files on my computer as possible, and as few legacy configurations as possible is a cleanliness and reliability goal.

Another reason for me to upgrade was to get new applications and features that wouldn't be deployed with normal upgrades. The main 3 features that come to mind for me were an EXT4 filesystem, GRUB 2, and starting fresh with my audio stack. I could have migrated and upgraded these things manually (the filesystem would have been a huge pain, and potentially corrupted my whole system in the process), but with the number of unknown factors in these, it was easier to begin again from scratch.

Before you start with a new distribution

Before you start, the most important thing is to make backups. Without backups your data is extremely likely to be lost. If you don't have good quality backups, your only hope when you data and applications and settings go missing is to give up and forget anything you lost.

I recommend you make a backup of your entire /home/ folder, as well as your /etc/ folder. You might not use either of these folders again, but they are extremely useful if you do need to restore an earlier system, or if you just want to copy or reference an earlier version. For example, my /etc/ backup came in handy about 2 months after upgrading recently; I needed to reference my /etc/X11/xorg.conf file to determine the proper setup for metamodes on my computer.

This is probably a good time to make a separate /home/ partition. Putting this folder on an entirely separate partition gives you the ease of upgrading, installing new distros, and trying things out in general. While changes to your operating system can completely break your install, there is almost nothing you can do to break your /home/ folder. Keep in mind one notable exception, which is if you have compositing enabled in your KDE settings in your home folder, you may not be able to boot into your desktop environment if you boot into an OS that doesn't support compositing. I recommend you disable compositing before doing any upgrades or reinstalls.

If you have spare disk space on another drive, you could rsync your entire root filesystem to a safe location. Most files are in /home/ or /etc/ that you would want to migrate, but occasionally there are files and programs that will store files in other places. Two examples of this are gitosis, which by default keeps its files in /opt, and any databases, which are likely to be stored in /var/db/.

Picking a distro

If you have a distro that you like, I wouldn't recommend starting from scratch while trying a new distro. New distributions are best learned in a virtual machine, or in a separate partition, where you still have something to fall back to.

Save your files

Here is a list of files you should consider transferring when you are moving to a new or updated distribution. One of the things I recommend is not transferring your home folder. At least for me, my home folder tends to get filled with configuration files from programs I ran months or years ago, as well as numerous files that should be sorted elsewhere. The strategy that worked for me was to have a separate home folder that I kept as a backup, and then copied files from as I discovered I needed them. If you have copies of the items below, that should cover some of your basic needs, but everyone uses their computers differently, so making sure you have a way to recover your files can be very important.

  • Browser Config
    This includes ~/.config/chromium/ or ~/mozilla/firefox/ depending on your browser of choice. The reason to keep this is that I believe there is value in saving your bookmarks (if you don't have online sync), as well as history and passwords. These are things not trivial to recreate in a new environment.
  • File System Tab
    This for me meant reading my old /etc/fstab file, and adding any entries that were missing from my new system. You don't want to just copy the old file because some of the entries may have different options or preferences chosen differently from your old distribution to your new one.
  • F-Spot (Or photo management)
    For F-spot, these files are located in ~/.config/f-spot/. This is important if you want to keep your database and organization associated with your images, especially if you don't store your tags in the files themselves (which I highly recommend)
  • Git Global Configuration
    Git stores several global configurations (such as your username and email address) when you set them up. It may be easier not to migrate the git configuration files, but simply keep track of what you had set in the old system, and remember to set these when you begin using Git in your new system. This item most likely only applies to developers.
  • Wine Environments
    These are stored in ~/.wine/, or if you use PlayOnLinux, they are stored in ~/.PlayOnLinux/. I highly recommend migrating these because they tend to be a lot of work to set up.
  • Virtual Machines
    Virtual machines have similar logic to Wine Environments in that you typically have them set up exactly as you need them, and they are non-trivial to rebuild to the same state.