I have a couple of Debian servers with only little users and services. The applications are kept as far as possible in their own directories where they can be backed-up or synced easily.
But I have trouble to find an easy and reliable way to back up the surrounding data and to easily to reapply it to new servers in case of upgrade/failovers etc. By surrounding data, I am referring to files in /etc, some dot-files in ~HOME or the crontab entries.
How would you improve the following strategy, when switching a server:
- Copy /etc/passwd, /etc/group and /etc/shadow from other server too keep numerical ids consistent
- Copy the whole /home directory and /root directory across
- Manually copy the the application settings in /etc (eg. /etc/apache2, /etc/php, /etc/proftpd... and their entries in /etc/default/tomcat6
- Install the programs via apt.
There are no human users, so no deed to keep contents of home directories synced. Its all about things like .ssh keys etc.