Ask Your Question
1

"upgrading" ubuntu to fedora

asked 2013-10-24 19:29:28 -0600

zedd2006 gravatar image

updated 2014-09-28 12:39:59 -0600

mether gravatar image

So a friend said that i could install fedora on top of ubuntu and keep everything in my home folder. Is this correct? I would like to keep the data, hence needing to keep the home folder.

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
5

answered 2013-10-24 21:22:39 -0600

Eddie gravatar image

updated 2013-10-25 11:16:46 -0600

How well this will work depends on how your current partitions are laid out, among other things. Definitely make a backup of all data you care about before you do this. I always make sure I have a complete backup of my entire system before I upgrade from one Fedora to another. So far, I've never needed the backup, but ... better safe than sorry.

If you currently have a separate /home partition, then all of that data will very likely be preserved if you install Fedora over an existing Ubuntu installation. But you will have to take care when you go through the partitioning steps to be sure that the /home partition is not reformatted.

If you currently do not have a separate partition for /home, which you can figure out with the df command, then I wouldn't count on the data being preserved across the install, although I suppose it is possible. I've never tried such an installation.

Whatever you do, make a complete backup of all data you care about first. You can use the rsync command to back your data up on an external disk, for example. Or just cd ~; cp -a . /path/to/external/drive. Then be sure that this external drive is not connected to your computer when you install Fedora. My backup media is always powered off during upgrades to avoid even the possibility of formatting the wrong drive.

With a full backup of you important data on an external drive, you can confidently (and carefully) do the installation, and if the /home partition is wiped by accident, just copy the data back from the external drive. You do back your data up periodically, right? Hard drives do fail, so if you care about this data, you want to have something to back it up to even when not doing installations of new Linux versions.

Note: As Gareth Jones says, post-install you need to be sure that file ownership (uid/gid) and SELinux attributes are appropriate. For the sake of argument, assuming you use the username zedd2006, post install as the root user you want to do this:

cd ~zedd2006
chown -R zedd2006:zedd2006 *
restorecon -Rv .

Those commands will set the correct new uid (user ID) and gid (group ID) and then apply the correct default SELinux context to all of your files.

edit flag offensive delete link more

Comments

I would also review all the hidden config files/folders in the home folder:

homedir=/home; for i in $(find "$homedir" -mindepth 1 -maxdepth 1 -print); do sudo find "$i" -maxdepth 1 | grep "^$i/\."; done;

maarten gravatar imagemaarten ( 2013-10-25 08:40:12 -0600 )edit

As far as I know, the Fedora installer will always insist of reformatting the / volume (maybe Kickstart can avoid this?), so unless /home is a separate volume, or you have space for another partition to install to, you’ll need a spare drive for transferring the files. If /home is a separate volume already, then keeping it is easy. Anaconda will warn you thoroughly about what volumes will be reformatted before continuing.

Gareth Jones gravatar imageGareth Jones ( 2013-10-25 10:36:56 -0600 )edit

Also, you may need to change the file permissions in /home to match Fedora’s user IDs if they differ from the Ubuntu installation’s, and you’ll need to “relabel” as Ubuntu doesn’t use SELinux. For that, update Fedora so that you have the latest SELinux configuration, run su -c "touch /.autorelabel", and reboot.

Gareth Jones gravatar imageGareth Jones ( 2013-10-25 10:38:33 -0600 )edit

@Gareth Jones: Right, you spelled it out more than I did, but I agree that the Fedora installer probably always wipes /, and rightly so. Also, keeping /home you'll have to be sure that file ownership and attributes are appropriate after the install. I'll add this to my answer.

Eddie gravatar imageEddie ( 2013-10-25 10:59:00 -0600 )edit
1

answered 2013-10-25 01:47:30 -0600

Bharat gravatar image

updated 2013-10-25 01:49:52 -0600

Well. As Eddie says, it depends on how you partitioned your disk(s). If you have a separate /home partition then during the fedora installation, select manual partitioning and just repartition / and /boot while retaining /home from the previous partition. You might have to specify that you need to load the old /home partition. it will have a device number like sdaX or hdaX which you want to now load with label /home. you can do it by modifying /etc/fstab

Usually the ubuntu deault installation settings doesnt make a separate /home partition and in that case you wont be able to retain your /home contents in the new installation

edit flag offensive delete link more
0

answered 2013-10-25 04:53:42 -0600

SuperDanceParty gravatar image

I just made a backup of my /home directory on a portable hardrive using dejadup (called 'backup' in the dash search, dejadup in the repositories, and filesystem). Make a backup on another drive, install fedora fresh, and restore from backup, and put the files back where they belong. It's quite easy using the features in dejadup when restoring, it gives the option to put everything back in the same places it was before, or in a separate directory so you can manually place items this time around.

I suggest manually doing so when switching distributions cause the home directory can contain packages and files that might not be compatible with fedora, or could cause other problems. For example, a hidden folder containing firefox extensions, would carry the Ubuntu firefox extension pack that comes preinstalled in firefox on Ubuntu, probably don't want to use in fedora with firefox.

Also, dejadup/backup doesn't come preinstalled on fedora, so you'll have to install it after. Just use sudo yum install dejadup and you can run it just the same as on Ubuntu.

I find this to be the easiest way, and the best way to ensure you can bring all your files over, and if something goes wrong during your OS install, you can safely wipe the hard drive and try again without worrying about losing anything. Any backup software will do the trick, I just prefer dejadup because it's particularly easy to use.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-10-24 19:29:28 -0600

Seen: 3,525 times

Last updated: Oct 25 '13