Something like this ought to be quite possible but I'm not sure if it exists. I'm using an Ubuntu Server install (11.04)
1. Make a note of the base install (eg ubuntu-server) and version, from which a fresh install could be done on new hardware 2. Create a list of all packages installed/uninstalled relative to that base (by name, not version, assume that a re-install would be applied to current versions of the same packages). 3. Backup all configuration files which were created by the above but have been changed from the distro installed versions, ideally as diffs against the original files. 4. Backup all files which are not part of the distro install (ie as defined by the above), with a list of exclusions (to avoid backing up log files, for example).
Does anything like this exist? It seems to me that it should be fairly straightforward (but my knowledge of the relevant packing tools isn't very good so I might be wrong). In principle it would be quite easy from this to backup (say) an 11.04 server and restore to an 11.10 install, and have something which would probably be pretty close to working. As an additional step, say 3a, it would be nice to do intelligent backups of certain files (eg proper database dumps to SQL) which could then be excluded from step 4.
Aside from the above, does anyone have a good recommendation for efficiently backing up an existing server via SSH without pulling all the base install stuff but without missing anything?
** Mark Rogers mark@quarella.co.uk [2011-08-09 16:07]:
Something like this ought to be quite possible but I'm not sure if it exists. I'm using an Ubuntu Server install (11.04)
- Make a note of the base install (eg ubuntu-server) and version,
from which a fresh install could be done on new hardware 2. Create a list of all packages installed/uninstalled relative to that base (by name, not version, assume that a re-install would be applied to current versions of the same packages). 3. Backup all configuration files which were created by the above but have been changed from the distro installed versions, ideally as diffs against the original files. 4. Backup all files which are not part of the distro install (ie as defined by the above), with a list of exclusions (to avoid backing up log files, for example).
Does anything like this exist? It seems to me that it should be fairly straightforward (but my knowledge of the relevant packing tools isn't very good so I might be wrong). In principle it would be quite easy from this to backup (say) an 11.04 server and restore to an 11.10 install, and have something which would probably be pretty close to working. As an additional step, say 3a, it would be nice to do intelligent backups of certain files (eg proper database dumps to SQL) which could then be excluded from step 4.
Aside from the above, does anyone have a good recommendation for efficiently backing up an existing server via SSH without pulling all the base install stuff but without missing anything?
** end quote [Mark Rogers]
It doesn't completely fit your description, but take a look at etckeeper [1]. I use it on my Ubuntu servers and I think it is in the standard repositories for Debian too - no idea about other distros, but there must be a good chance. It basically stores changes to files in /etc in a git, bzr, or other repository, and by being tied into apt or other package manager, automatically notes new config files as packages are installed (so will keep some sort of record of what packages have been installed and when.
[1] http://kitenet.net/~joey/code/etckeeper/ [2] https://help.ubuntu.com/10.04/serverguide/C/etckeeper.html
On 09/08/11 16:55, Paul Tansom wrote:
It doesn't completely fit your description, but take a look at etckeeper [1].
Thanks, I'll take a look.
The problem I'm trying to solve is that I don't want to store anything from /etc that I haven't changed from the package defaults; it's not just about saving space, it's about knowing what was changed and if I "restore" to a newer version of the distro I don't want the old distro's default files copied across, but I *do* want to merge across any changes I made.
Also, I want to know which packages were installed/uninstalled so that I can quickly get all the relevant software installed, but I also want pick up anything else that might have been installed from another source (whether .deb or not).
Which tools should I be looking at to generate a list of packages installed, and files installed by them? I'm assuming apt or aptitude, or do I need to work at a dpkg level? I think I need to have a go at writing something in order to prove it's nowhere near as simple as it seems and I should walk away from it :-) I know the information is there, from simple things like having apt know to ask me if I want to keep my changed config files during an update.