Sep 03

I have been a GNU/Linux user for a year now, and in this time I changed 4-5 distributions. In this process, even when reinstalling the same distro, I wasn’t aware that I could keep the settings and configurations of my applications.

This can be done by creating a separate partition on the initial installation called /home. The /home folder is where the GNU/Linux Operating Systems keep the data of the user, the configuration files of the applications installed and much more. A /home partition also gives you the opportunity to share the same /home folder between two GNU/Linux installations on the same computer, this meaning sharing the same settings for the same applications.

If you haven’t created a /home partition when installing your OS, you can do it even after installation. This is not my topic here though, googling it will present you lots of how-tos.

I decided to put the /home partition to the test. So I checked what happens to it and it’s data when switching trough distros. I chose the distros based on my knowledge of them but most importantly to cover miscellaneous  based systems. I followed this order:

Ubuntu 9.04 (Debian)> Sabayon 4.1 (Gentoo)> Fedora 11 (Red Hat)> Ubuntu 9.04

Ubuntu

I started by creating a /home partition on a clean install of Ubuntu 9.04. For this test I did the following:

  • Saved some files on my desktop, in the pictures and documents folder of the /home folder
  • Installed Firefox, added addons and themes, and changed random settings
  • Installed Thunderbird, added 2-3 accounts, downloaded my emails, saved some of them in local folders
  • Installed Pidgin, added my MSN account, added some emoticons and changed some settings

Sabayon

I then installed Sabayon 4.1. During the installation, when setting the partition I previously used for /home in Ubuntu as /home for Sabayon, I was asked whether to keep my data, and I answered yes. However when inside Sabayon after the installation finished, I realised that it had placed my Ubuntu /home folder in a new folder named username.backup.0 , inside the new /home folder, keeping all my data and files safe but not used.

I tried to replace the application folders manually to check if I could restore my previous settings. You  must run at least 1 time the program you want it’s settings to restore, before moving on to replace the files. This will create the settings folder in your current OS so you can replace it afterwards. It’s not necessary to do anything after running the program, just click cancel if asked and exit.

Starting from Firefox, I replaced the .mozilla folder inside the /home folder with the one in username.backup.0 (remember that “.folders” are hidden by default in GNU/Linux, click on View>Show hidden files or press Ctrl-H). I was asked what to do with the files and folders already existing, I selected merge all and replace all. It worked! Running Firefox after, all my add-ons were back. I only had to manually enable the theme, but it was present too.

Thunderbird was a bit trickier. In Ubuntu the folder is called .mozilla-thunderbird, while in Sabayon .thunderbird. In the .thunderbird folder a subfolder with a name of the type rzwyc9rt.default existed. I found a similar one in .mozilla-thunderbird. I went ahead and replaced the contents of the 2nd into the 1st (remember to merge and replace all). I kept the .ini and appreg files. and ran Thunderbird again. As a result, I had my old settings back, my local folders and my emails were there!

On I went to do the same with Pidgin and it was must simpler here. Just have in mind that the folder for Pidgin is named .purple in both distros. I merged and replaced. Ran Pidgin after this and I had my account, settings, old statuses and smileys back.

This can be done for any application you like, just as long you find the folder where it stores it’s data in /home. What’s more, the same method can be used if you want to transfer your settings for certain applications from one PC running GNU/Linux to another.

Fedora 11

I then installed Fedora 11 and undertook the same procedure. Have in mind that I never deleted the .username.backup.0 folder, but kept it inside the /home partition among with the /home folder that Sabayon created.

Fedora never asked to keep my settings during the initial installation, I just mounted the /home partition without formatting it and installed. After reboot, I was asked for a login username. I used the same as on the previous distros, and because of that the system found my /home folder and asked me to import everything. That’s cool! I wonder what would happen if I didn’t use the same username though. Probably a backup folder like Sabayon?

After logging in I had another positive surprise: the system had kept my settings for the wireless-LAN and automatically connected!

My Home folder was kept untouched, so was the username.backup.0 one. All my files, music and pictures present. Firefox was OK with all add-ons. Same with Thunderbird. The only problem was that because Fedora 11 uses new beta releases, some add-ons weren’t supported, but thats expected. Changing to the edition of the application you used before should do the trick. In Pidgin too, everything was working as it was supposed to.

Back to Ubuntu 9.04

Finally, if I could go back to Ubuntu and have the same system I used at the beginning, this test would be a success. And it was! Everything worked just perfect! It was like I had never switched through the distros above. Sabayon played some tricks on me, but since it never deleted my files I guess I can live with the bit of extra work of manually replacing the folders for the applications I want.

To Sum Up:

If you usually format your PC, use a dual boot, or like to change distros a /home partition would save you lots of time. Setting up applications is the only thing that takes some of my time after a clean install. The /home partition enables me to save that time. It also saves me time from writing down all the add-ons, passwords and extras for my applications to remember to install them again after the format (it’s pathetic, but this is what I did so far!). But now having all these in mind, reinstalling and switching distributions couldn’t be faster.

It is my belief that the developers of the GNU/Linux Operating Systems should try and make the switch through various distributions as compatible and easy as possible. This is very important in the free software community. Not to be locked in one distro.

If you tried switching to an unmentioned distribution, I would like to hear and learn more on the experiences and troubleshoots of it.

8 Responses to “Switch distributions – Keep your files & settings”

  1. Gen2ly says:

    You can have distro’s share a home partition but it takes a bit of work. The tricky thing would be matching group names as sometimes they can be done differently. Well, to save repeating words :), here is what i’ve wrote before:

    http://linuxtidbits.wordpress.com/2009/08/17/dedicated-home-partition/

  2. I have done this on Fedora for some time but haven’t tried to do it on Ubuntu yet. Thanks for the nice post.. it reminded to add this to my Ubuntu to do list 🙂

  3. Azerthoth says:

    The issue here, and why this will fail more often than it will work, your files arent assigned to an owner by name but rather UID. If the UID on the new system does not match the UID of the files, its broken.

    UID’s are not the same from system to system, let alone from distro to distro.

  4. PePa says:

    If the UID is the only issue, it can easily be solved with a ‘chown’. I think a trickier issue is different versions of applications might get confused with settings from another version.

  5. KenP says:

    I keep a separate partition called common_home which contains the common folders and personal data. From this, I symlink them to the ”
    “real” /home created by a new distribution.
    Typically, I symlink:
    .mozilla
    .wine
    etc along with standard folders like Documents, Pictures, Music, Downloads …

    Once you set the label for the common partition to a identifiable value, you can’t go wrong.

  6. Captain Tux says:

    Good article… I like how you hammer home the idea of a /home partition.

    Here’s another article on switching distros from the good folks at TuxRadar (the editors of Linux Format magazine):

    http://tuxradar.com/content/pain-free-guide-switching-distros

  7. tetris4 says:

    @ All: Thnx for the links and additional info guys..Useful indeed!

    @ Azerthoth & PePa: If the UID is indeed one of the problems, I think an “import” option during the installation of any distro would be really helpful..Don’t know how easy this would be technically though for the developers.. =)

    @ PePa: As for the different versions of applications and the settings being mixed up, isn’t this already a trouble even if you have one distro installed? =p

  8. Linerd says:

    This is a good idea whether you plan on distro hopping or not. The upgrade process has gotten much better in Ubuntu, but there always seems to be some new feature that only seems to work properly on a fresh install as opposed to an upgrade.

    I created a new home partition without performing a fresh install by following the procedure on this page – http://embraceubuntu.com/2006/01/29/move-home-to-its-own-partition/

    This procedure worked well for me.

Leave a Reply

preload preload preload