How does your file system looks like? I mean, I like to keep all my important things at /home/, so when I need to make a backup, format and restore, I simple compress all my /home/ with tar and gunzip and then when the system is fully reinstalled, I simply uncompress the file at my home again. Even the config files for every individual applications are saved (I'm referring to those hidden files/folders starting with a dot).
That should be the easiest way to backup/restore a system. If you want/can use this method, then simply:
tar cvf files.tar /home/user
where c = create, v = verbose, f = to file output(?) instead of using tape archive
tar(short for tape archiver, when we actually used tapes to store data...does anyone still uses that by the way? ghehe...) won't actually compress anything, but archive the file structure and create one file (here suggested as files.tar) where user is your actual user. Before compressing, it's always a good idea to look inside the file to see if the structure is correct:
tar tv files.tar
where t=table of contents, v=verbose. If everything looks fine, then compress it:
gzip -cv files.tar
c=create, v=verbose. You can use other tools for compressing, such as "compress" (old) or "jar" (does not compress as well as "compress" or "gzip"...).
When you are done backing up your files and your new system is completely restored, then create a new home directory:
mkdir /home/newuser
cd newuser
and uncompress the files:
gunzip files.tar.gz
tar xvf files.tar
where x=extract. You can, alternatively, extract individual files from the tar file. I use this when I've backup something that I don't need to restore right now (like wallpapers or other useless things that I might add later
). That is done with:
tar xvf files.tar filename1 filename2 filename3
Move the files if you need. When your file system structure is good enough, you can move the newhome to your user real name/home directory and hopefully, nothing was lost
Regards!