Linux – Copy entire Centos server to another

centoslinux

I've spent ages installing my current Centos dedicated server (OVH, Kimsufi). I want to move it to another server which will have different hardware although OS will remain the same.

My question is: is there an easy way of copying entire system as it is to a new server without messing up it's existing hardware settings? Cloning entire disk is out of question, because new server will have different hardware (disk size will remain the same though).

Is it possible just to copy certain folders then? like /etc, /home, /usr, /var where all installed and configured stuff resides, or will that still break the new server? I haven't created any custom root folders.

Best Answer

For Redhat derived systems (including CentOS), your hardware configuration is going to be mostly in /etc/modprobe.conf, /etc/sysconfig/hwconf, your initial ramdisk image (/boot/initrd-[kernel-version].img), and /etc/udev directory (this is where persistent device names are stored).

However, you may also want to record a list of your system tweaks. To help with this, you can use the RPM database to give you a list of configuration files that you have modified (it stores the MD5 sum of the original installed configuration files for any package, and you can compare this to the existing files in your filesystem to generate a list of what you had modified). Also, make a list of anything that exists in the filesystem that is not in the RPM database. Finally, make a list of all packages that were installed, possibly splitting this into two lists -- OS provided packages, and third party packages. This should give you a collection of minimum files that you need to put into your disaster recovery documentation, along with helping you clone your server when needed.

Related Topic