Ubuntu version upgrade

Every installation of your Ubuntu LINUX operating system somewhen comes to the point when it is necessary to upgrade to the next version. It is often recommended to set up a new completely clean system to get rid of old stuff. But sometimes you just need to get to the next version quickly without coping with the question what you still need and what not. That is why your demand for a version update is still a valid one.
As there may be lots of difficulties. You might for example discover after installation that one important driver is not (yet) available for the new version. For such a case it is a good idea to keep a backup that enables you to recover yur old systemk.
First of all I recommend to bring the current installed version to most recent state. This makes sure that as little as possible is changed during the version switch which implies that as little as possible errors might occur. Therefore open a command line terminal (ctrl+alt+t) and enter:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Afterwards clean the software archives such that no superflous ones add up to backup size and time:

sudo apt-get autoremove
sudo apt-get autoclean

I furthermore suggest to delete some old kernel files from /boot . Usually you only need the newest one but I tend to keep three just to be on the safe side. Erase all others by e.g.:

sudo rm -f /boot/*3.0.0-13*

Now it is time to make the backup itself. It makes sense to ommit some directories which are not needed to get your system back to the old state. One also could exclude /home completely but there are some configs which might be lost that way:

sudo tar -cvjp --exclude=/dev/* --exclude=/proc/* --exclude=/sys/* --exclude=/home/system-backup.tar.bz2.* /* | sudo split -d -a 6 -b 700MB - /home/system-backup.tar.bz2.

"tar" is a compression program which puts all files for backup into an archive. "c" tells it to compress the files. "v" enabled the verbose mode which will give detailed output information. "j" tell tar to compress files in bz2 format. "p" preserves all file permissions.
"split" partitions the archive into multiple parts. This is useful when you plan to burn it e.g. on DVD. "-d" makes split create numbers instead of letters as suffix which may sometimes be easier to sort on recovery. "-a 6" creates a suffix which is six characters wide. When you encounter the error message "split: Output file suffixes exhausted" increase the number behind "-a". "-b 700MB" created images of 700 MB size which is suitable for burning it to CD. You can also use "GB" which might be useful if you want to keep file system limits. FAT32 for example is only capable to handle a maximum size of 4 GB for single files.
Now that we have backed up everything we can upgrade the version:

sudo apt-get install update-manager-core
sudo do-release-upgrade

Now we come maybe to the most important part of the backup - recovery. If you encounter an unwanted behavior with the new version which you can not tolerate you have to first boot from a live cd. That may be a dedicated distribution like knoppix but you can either use your Ubuntu installation CD when you quit the installation dialogue after the basic system has booted. Open a command line terminal and mount the harddisk. Usually it is one from /dev/sda* which you can check after mounting:

sudo mkdir /oldsystem
sudo mount /dev/sda3 /oldsystem -w
sudo ls /oldsystem/home

If you don't see the backup files simply unmount the hard disk and mount the next one until you find them:

sudo unmount /oldsystem

Now you can extract you old files and reboot the system:

sudo cat /oldsytem/home/system-backup.tar.bz2* | sudo tar -xvpjf - -C /oldsystem/
sudo reboot