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.

I reinstalled Ubuntu 12.04 after a corruption caused by a faulty operation (not much interesting but you can read about it). The old system had three partitions, one for boot, one for / and one for home. I followed these instructions to restore the system keeping my home dir. Basically what I did was:

  1. full backup of the old disc using dd
  2. export the list of installed packages in the old system
  3. reinstall Ubuntu 12.04 not formatting the partition containing home directories
  4. reinstall the packages I had in the old system using the list of step 1.

Everything still works and most of the settings have been kept, but not all. I have my desktop icons, my firefox bookmarks, etc. But other configurations have been lost.

Now I'd like to replace the /etc of the new system with the /etc of the old one - I have a copy of it - so to have the same system as before, or at least very similar.

Before trying by myself to swap the new /etc with the old one I'd like to be aware of the possible issues which could arise, so to prevent bad things from happening again.

Any thoughts or suggestions?

share|improve this question
    
I would suggest to copy only user related files. So /etc/apache2/*conf /etc/apache2/sites-/ if you have apache. –  Rinzwind Dec 10 '12 at 14:22
    
Yes, also /etc/hosts, and so. The problem for me is to know which files or directories to copy and which not... –  Paolo Dec 10 '12 at 14:23
1  
/etc contains many directories but most of them are used only by system and you don't need to worry about. The configurations you need to change in /etc are the ones from software you manually modified the config like apache, mysql, openvpn, cron jobs, ufw... and these should not be that much. Anyways keep the backup at hand and when you see something not working you can quickly compare the 2 /etc. –  laurent Dec 10 '12 at 14:45
    
I have not seen a list of /etc/ content related to user (well I know about apache2 and hosts, fstab and mtab ; I also found a ref to ftp.users if you use ftp. mysql normally is in /var). I agree with laurent: make a compare. –  Rinzwind Dec 10 '12 at 15:38

1 Answer 1

If you are using the same computer you are probably safe but don't replace /etc/fstab, you want to use your new system partitions, not the old ones.

If this is a different system all hardware-related files (like hdparm.conf, sane.d) could cause trouble.

If you just want to transfer a couple of settings (like printers and network config) it's probably wiser to only copy the files and dirs that you want to keep.

share|improve this answer
    
On a second reading, I have given no concrete answer... just ifs... ;). –  Javier Rivera Dec 10 '12 at 14:19
2  
It is concrete instead. Because copying fstab from old to new would give a boot problem. –  Paolo Dec 10 '12 at 14:24
    
+1 but pay attention to other tricky files like fstab mentioned above that we can't remember now but will remember once the problem arise!! - mainly in the hardware configuration parts, even on same machine :). I would follow last suggestion from Javier, only copy the settings you need. Don't forget to take a backup of the new /etc before anything of course! –  laurent Dec 10 '12 at 14:33

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.