Backing up settings in Linux/Ubuntu

Deja Dup Backup tool

Deja Dup Ubuntu's official backup Program

Deja Dup Ubuntu’s official backup Program

Ubuntu provides an efficient backup tool called “Deja Dup Backup tool” which can backup entire home directory. Deja Dup can be scheduled to run automatically as well. It is a front end of Duplicity. Other distros also provide or one can always install some program for scheduled BackUps. But there are various reasons when we may not want whole directory to be backed up or do not have time or resources to run ‘Backup’. There may also be a situation that we may not want to restore everything but be selective. In other words what if we want to restore settings of only a few programs. For example autotext and other settings of Open Office.
Solution to all these problems is Manual Back up or copying the settings in a compressed (or uncompressed) folder.
I personally find that these automatic backups as these are useful only if whole hard disk crashes with absolute no chance of even partial recovery. But real situation is always more complicated even if less worse.

Backing up settings of individual program

The settings of individual programs are saved in hidden folders in home directory. For example my user name is ‘sand’ and I want to find settings of Mozilla. Open ‘/home’ click ‘sand’ now either press “Control+H” in nautilus or select ‘Show hidden files’ from View manu. It will show numerous folders with names starting from .(Dot). Find .mozilla and copy it to the folder of our choice for future.

Selective Back up is particularly useful in case of change of Distro. For example if we are using Ubuntu and decide to change to Mint, even if the latter is a derivative, it may not work properly with old /home directory structure. It is better to back up entire directory or some of the third-party program folders separately and replace them one by one, as may be required, from time to time and leaving out the system/Distro folders altogether.

Backup all settings of all programs

We may select all folders in /home directory, beginning with dot and copy for safe backup. Alternatively select all dot folders and right click the mouse and choose ‘compress files’ follow directions and save in compressed file/archive. We can extract one or more folders as per requirement. One caution. The archive manager may give error warning if there is a hard link within any folder and that folder may not decompress later.
Some programs which save some or all of its settings elsewhere, would be excluded.

Other tools for backing up

Rsync is a powerful command line utility to back up or sync the large folders or even entire drive. There are two excellent GUI options available in Ubuntu Software Center. These are:

1. File Backup Manager (based on rdiff-backup)

File Backup Manager

File Backup Manager

2. Lucky Backup (based on rsync)

With the help of above a selective backup of /home can be obtained at any time.

© Sandeep Bhalla


Detailed instructions for migrating Home Folder into its own dedicated partition.

Setting up /home on a separate partition is beneficial because your settings, files, and desktop will be maintained if you upgrade, reinstall Ubuntu or another distro. This works because /home has a sub-folder for each users settings and files which contain all the data & settings of that user. Telling Ubuntu to use an existing home partition can be done by selecting “Manual Partitioning” during the installation of Ubuntu and specifying that you want your home partitions mount point to be /home, being careful to make sure that the partition will not be formatted in the process. You should also make sure the usernames you enter for accounts during installation match usernames that existed in a previous installation. (via Partitioning/Home/Moving – Community Ubuntu Documentation.)

Reverse tweak by moving the OS

The above method is slightly advanced and therefore cumbersome. However there is an easy way. Do we know why the home folder is kept on separate partition? My idea to keep it separate is two fold either to keep it encrypted or to retain the individual program settings or both. Now for this method to work the home folder should not be encrypted.
Now the method:

Boot from live-cd or usb. Open nautilus as su. (Command is “gksudo nautilus’)
From view menu select hidden types. Now be careful. Select the drive where home is installed. Delete all directories except home. Yes delete all. Now click hom. Once inside home select all (by ctrl+a). Now ctrl+x. Move up one level. Now we can again see the home folder. Paste the contents of home by pressing ctrl+v. Once done. Find home folder and delete it. Unmount the drive.

Open GParted. (if it is not there install it by running “sudo apt-get install gparted”)
Now with GParted create a new partition for linux root “/” . This is where a new installation will take place. This should have a 12 GB space. That is good enough.

Now exit from the GParted and click install-ubuntu. Go to advanced Options and select the new partition as root, old partition as ‘home’ and swp as swap respectively. All settings for all programs are intact and shall be adapted by programs as and when we install that program.

This method can also be used for installing a new version without disturbing the settings.