This can be done with software already shipping with the system (so in short, I'm recommending you a software called "Linux" ;). As you didn't specify the flavor of Linux used, I'll outline it for Debian based systems here. The very same principle should also work for other Linux systems; you've just to adjust the
dpkg part to its corresponding counterpart (e.g.
1. User configuration (generic)
All user specific configuration etc. is stored inside the users home directories, which usually reside below
/home/izzy could be mine). I'm always making
/home a separate partition for easy portability (so I could even install a new Linux without touching
/home, and still re-use my settings afterwards). So to transfer all the users settings and files, you simply have to copy their home directories.
Software to be used for this part:
scp, Midnight Commander, any other file manager – all either pre-installed or at least available via standard repositories.
2. Installed software (Debian specific here)
On Linux, one usually installs software via repositories. So the corresponding repository manager keeps track of changes. I will describe this part for Debian based systems here, but it should be adaptable to almost all other Linux flavors:
Right after the first (virgin) install of your initial system, have your packager export a list of software it installed. On Debian, this can be done as follows:
dpkg --get-selections > initial_packages.txt
When the day comes you're about to move to a different machine, do the same thing again (just re-direct output to a different file, e.g.
final_packages.txt). The use a "diff tool" to show the differences between the two files, and you should be able to figure which additional packages you've got to install on the new system – and which to possibly remove. Raw example ("pseudo code", you'll need to fine-tune this):
diff -u initial_packages.txt final_packages.txt | egrep '^\+' > install_me.txt
diff -u initial_packages.txt final_packages.txt | egrep '^\-' > remove_me.txt
Explanation: The resulting diff would have lines (packages) added prefixed by a
+, while lines removed are prefixed by a
-. Everything else is just for context and can be ignored. So following above two commands, you've got a list of packages which you need to install to the new system, and optionally another one to remove.
Make sure to take your repository configuration along to the new machine, especially when you've adjusted it. Corresponding files are
Software needed for this part:
grep – all come pre-installed.
Note: Some differences might be "ignorable" and have to be skipped. This applies e.g. to kernel updates the system applied automatically. So make sure to manually check your resulting list.
3. System-wide configuration changes (generic)
For this part it's a good idea to keep track of what you're changing, so it's easier to apply these adjustments to the new system. But even if you forgot, if you notice something related on the new system, you might remember again and refer to what you did on the "old" one. Good idea to have the relevant stuff available for reference. Again, with pre-installed software, you can take care for that:
tar cjf old_machine_config.tar.bz2 /etc/*
scp old_machine_config.tar.bz2 new_machine:/opt/backup
should do that for you (adjust names and path as required – and of course you could also use
tar czf with a
.tar.gz file instead).
Software used for this part:
gzip – all ship with your Linux distribution, and are usually pre-installed.
4. Other differences
- system specific stuff (like proprietary drivers for your hardware) are explicitly ignored here (and you should ignore that part as well when following above "instructions": keep step 2 specific to your software (dependencies will be dealt with by
yum/… themselves), ignore system specific stuff as drivers and libraries unless you know you will need those on the new system e.g. for development purposes)
- software manually installed by you with other means then the package manager might not be covered either. If you used CheckInstall, it would be listed by the diff in step 2, but you would need to take care for the "sources" (here: the
.deb packages) yourself. Otherwise, you need to track those separately.
- if you stored files outside your home directory (e.g. under
/opt), you will need to cover those separately, too.
This looks like a long and cumbersome process (instead of a simple point-and-click), but actually shouldn't be too complicated as long as you've kept care for it from the beginning (with the initial package list export in step #2). It might get a little trickier if you manually installed software from places other than configured repositories (or if one of the repositories used "died"). Here you need to take care for yourself: keeping log of those changes, store the sources in a specific directory, maybe keeping the
.deb files from "minor repositories" as backups (hint: Debian caches a copy for some days at least in
/var/cache/apt/archives, where you could pick them from).
But after all: this should do, comes for free, and all components required are already on your machine :) Moreover: With a new machine, you probably also want to install an up-to-date version of your Linux distribution. "Imaging" your current install won't take care for that – but above described procedure does. Just keep in mind that some changes (central config, packages added/removed) might need to consider this as well, so better cross-check before applying changes to your new system then :)
And finally: As all software required already comes with your system, you don't need to acquire any additional pieces.