I manage a virtual web server in the cloud (https://l10n.org.al) where I have made lots of configurations over time: installing new packages, tweakings for optimization, changes related to security, etc. Now, if I want to build another server that has the same function and purpose as the first one, I don't remember all the things that I have touched and changed. The long and tedious way would be to go over all the installations and configurations again, and still I may miss something.
I thought that maybe there is any tool out there that can make something like a diff between the current state of the server and the initial state of a just installed server. This diff would also help me to audit the current system, because some of the things that I have tested maybe are not needed anymore. Such a diff could also serve as a recipe that I can share with my friends, if they want to build a system like mine. It would be much more convenient and safe than passing around huge tarballs or images.
However I couldn't find anything suitable that can do it automatically, so I tried to do it manually. The basic idea is that the configuration files are placed on
/etc. If two systems have the same packages installed, and you make a diff of their
/etcdirectories, you will basically get all the configuration changes between them (maybe not 100% of them but still very accurate).
So, what I did to find the configuration changes on my system was this:
- Install a minimal system with debootstrap:
- Install the packages debootstrap and dchroot:
- Add these line to
- Bootstrap the chroot with a minimal Ubuntu installation:
- Make sure to install on the chroot system all the packages that are installed on the main system:
- Find a list of the packages installed in the main (host) system:
- Find a list of the packages installed in the chroot system:
- Make a diff between the two package lists:
- Install on the chroot system all the packages that are installed on the main system:
- Make a diff between the
/etcdirs of both systems:
Of course, this diff cannot be readily used to install and configure another system, but knowing where are the differences and what they are, can help to redo them manually.
It can also help to build a tklpatch (like this: https://github.com/dashohoxha/B-Translator/tree/master/tklpatch), which of course is not quite easy to be done and requires some work. Then, I can distribute/publish this tklpatch and everybody can build easily a system quite similar to mine.
Date: 2013-02-22 22:19:54 CET
HTML generated by org-mode 6.33x in emacs 23