[CentOS] Best way to duplicate a live Centos 5 server?

Fri Jun 8 18:09:08 UTC 2012
Les Mikesell <lesmikesell at gmail.com>

On Fri, Jun 8, 2012 at 12:04 PM, Scott Silva <ssilva at sgvwater.com> wrote:
>
>> Am I missing something glaringly obvious here, or is the only way I'm
>> going be able to migrate is to shutdown the C5 server for a few hours
>> while duping the old drives? Would greatly appreciate any pointers how
>> best to do this.
> You could always rsync the old server to the new one... a few runs will get
> 99% of the files, and a quick run after the shutdown can get the rest... Have
> a tar file ready of the needed config changes ready and untar it and start up
> the new system...

An interesting variation on this is to use 'ReaR' to back up and
restore the machine, essentially cloning it but give the copy a
different IP address as you bring it up.  Then when the clone is close
to ready to take over, shut down your apps for the time it takes a
final rsync to fix up the differences (in the data areas only - avoid
/etc/, (etc.), then switch the IP.

ReaR is in active development now and is very usable.  It is a set of
shell scripts designed to run live backups that are capable of
restoring to bare metal.   It makes a new boot iso with tools from the
running system to reconstruct the filesystem (including lvm/raid,
etc.) and restore on top of that.   Several backup methods are
supported but tar to an nfs location is probably the easiest to set
up.  With a small amount of extra work you can tweak the filesystem
layout, etc. if you don't want an exact clone.  With hardware
differences you might need to tweak modules and build a new initrd,
too.  ReaR is packaged in EPEL as rear.

-- 
   Les Mikesell
      lesmikesell at gmail.com