Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My old computer, with Ubuntu 10.04, crashed, and I installed Ubuntu 12.04 on a new computer. Luckily, I have a full backup of my previous file system. However, I don't know what folders exactly I need to restore (except the home folder, of course), since restoring the wrong files might damage the new files that came with the fresh installation.

I suppose that if I understand what each folder is used for, I can know whether it makes sense to restore it. Specifically, I would like to know about the following folders:

  • /boot - What is it? Should I restore it? (my 12.04 computer currently boots OK).
  • /etc - contains a lot of folders, most of them also exist on my 12.04 computer. Should I just restore all the /etc folder? Should I do it before or after I install the relevant applications?
  • /etc/apache2 - I changed some configurations. However, the I already installed apache2 on my 12.04 computer, and the configuration files look different. Probably the new version of apache2 has some new configurations. Should I just merge each file manually? same question with /etc/mysql.
  • /var/backups - Contains some files I don't recognize, such as aptitude.pkgstates., dpkg.status., group.bak, shadow.bak, etc. Most of them already exist on my new /var/backup . Who creates those files, and who users them? Do I need to restore them?
  • /var/cache - many folders that I don't recognize. Who created them? Who uses them? Should I restore them?
  • /var/lib - again, many folders that I don't recognize. Specifically:
  • /var/lib/mysql - contains my old databases. Is it safe to just copy all of them? Should I do this before or after I re-install MySQL? Are they compatible with the new version? (I had 5.1, the current version is 5.5)
share|improve this question

1 Answer 1

up vote 3 down vote accepted
  1. /boot: Initial boot (kernel/initramfs) images and other boot configuration. DO NOT restore.
  2. /etc: Usually all kinds of configuration files for the system and other applications. DO NOT restore except for single configuration files for specific applications.
  3. /etc/apache2 and /etc/mysql: reinstall and intelligently merge/copy old configuration over to new config files.
  4. /var/backups: most are dynamically created and managed by the system. DO NOT restore.
  5. /var/cache: same as above, DO NOT restore.
  6. /var/lib, /var/lib/mysql, /var/www, etc.: restore only the DATA (or import it, etc.) after reinstalling the applications (apache, mysql, etc.).
share|improve this answer
    
Great summary, thanks. –  Erel Segal Halevi Jul 30 '12 at 4:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.