From: Les Mikesell lesmikesell@gmail.com Subject: Re: [CentOS] Best way to duplicate a live Centos 5 server? To: CentOS mailing list centos@centos.org
On Fri, Jun 8, 2012 at 12:04 PM, Scott Silva ssilva@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.
ReaR has suddenly become very interesting to me, probably explaining why it utterly fails to work properly (for me).I'm using 1.13 to pull a USB-based recovery image, but there's an error in the backup/NETFS/default/50_make_backup.sh script that doesn't mount the USB device after the mkrecovery step, so subsequent tar fails on write to the non-existent mountpoint. I fixed that, but on recovery it fails to mount the necessary directories on the restore drive as well, so "rear recover" quickly bombs out. Is anyone having any success actually using ReaR on CentOS 6.x? - csawyer
On Mon, Jun 18, 2012 at 11:21 AM, Cal Sawyer cal-s@blue-bolt.com wrote:
ReaR has suddenly become very interesting to me, probably explaining why it utterly fails to work properly (for me).I'm using 1.13 to pull a USB-based recovery image, but there's an error in the backup/NETFS/default/50_make_backup.sh script that doesn't mount the USB device after the mkrecovery step, so subsequent tar fails on write to the non-existent mountpoint. I fixed that, but on recovery it fails to mount the necessary directories on the restore drive as well, so "rear recover" quickly bombs out. Is anyone having any success actually using ReaR on CentOS 6.x? - csawyer
It intentionally doesn't deal with drives the kernel has marked as removable. I had trouble with that with the main drives on a SAS hotswap backplane in an earlier version but I think that is fixed now.
I'd recommend asking how to override this on the ReaR mail list. While the code seems usable (and yes, I have succeeded in using it on Centos 6x.), the documentation either doesn't exist yet or is very out of date. But, the authors are very responsive and it would be good to let them know about any bugs or usability problems. The mail list is still at sourceforge although the code has been moved to github and there is talk of moving the list elsewhere.