Linux – Copy Linux host to new hardware

hardwarehplinux

I need to do host to host migrations from old hardware to new hardware. Specifically, from HP BL460G7 to HP BL460G8. Both the old and new servers have 2 x 600GB 2.5" drives and are configured for RAID1. I can afford 30 minutes downtime per server.

There are four servers to migrate, the smallest has a total of 120GB allocated in logical volumes and the largest has 510GB allocated. Three servers are running RHEL5 and one is running RHEL6.

I've been racking my brain on how to do this within the given time frame and without destroying the OS and critical data.

My only thought is this:

  • remove one drive from the old server (server is turned on)
  • remove both drives from the new server (server is turned off)
  • remove G7 drive from caddy and set aside
  • remove G8 drive from caddy and install into G7 caddy
  • install G8 drive in G7 caddy into old server
  • wait for RAID controller to rebuild RAID1 array
  • when finished shutdown old server
  • remove G8 drive in G7 caddy
  • install G8 drive in G8 caddy and insert into G8 (single drive installed)
  • boot G8 server
  • wait for OS to boot
  • when OS has booted insert remaining drive
  • wait for RAID array to rebuild

Does this sound sane?

EDIT: The RHEL5 are RHEL5.10 and the RHEL6 is RHEL6.6

I should have also noted that two of the systems are part of a hot four node cluster that does near constant replication of application "events" (its part of a critical infrastructure system). We have backups but we only use the in the event of total system failure.

Previous testing has shown about a maximum 'dd' between systems of around 50MBps which is far too slow.

EDIT: I was going to rely on kudzu to pickup and deal with the hardware changes.

Best Answer

It should be noted, that there may be other steps needed, depending on the distribution. Most notably the drivers (thanks for pointing that out @ewwhite).

  1. Boot the new server from livecd/usb.
  2. Prepare partitions and bootblock on the new drives.
    • Depending on setup, this could be done by copying MBR/bootblock.
  3. Make the filesystems.
  4. Do an rsync from old server to new.
    • You might want to do it again to see how long will the follow-up rsync take - if its under 30 minutes, continue.
    • This is the time, you can actually try, if new system boots. Just be careful not to cause any IP (or other) conflicts.
  5. Shutdown all services that would write to the filesystem
    • Preferably reboot to livecd/usb
  6. Rsync data from old server to new again
  7. Reboot the new server and use it

Doing it this way, you still have the original server intact, so if anything goes wrong, there is an easy way back. But it requires some knowledge (grub/rsync/partitions), so I suggest doing some prep-work and testing in advance, before doing it live.