Create Image of Server

Hi,

First, I will preface this with; I am not very familiar with FreeBSD. One of the hard drives has failed in our server, which is getting older and needs to be replaced. It is hosting a website using apache and has software/data that uses mysql, and is very crucial to the business. I am not sure how it is installed, or what is all needed to just set it up/configure a new server.

I am wondering if there is a way to take an image of the current FreeBSD OS on the server (while it is running), and restore it to a new server so I don't have to worry about reinstalling software and trying to get it configured correctly.

Thanks!
 
Make sure you also have proper backups (mysqldump(1)) of the MySQL databases. Just in case the machine decides to die before you have the new system up and running. I'm actually hoping you already have those but it's always a good idea to check and verify.
 
... I am wondering if there is a way to take an image of the current FreeBSD OS on the server (while it is running), and restore it to a new server so I don't have to worry about reinstalling software and trying to get it configured correctly.

It is possible, while your requirement of doing it "while it is running" limits the number of possibilities, and I doubt that the dump(8)/restore(8) combo would be the best choice, especially in cases when there may be already some read failures on the old disk. The most fail safe option would be file system cloning.

In case we are talking about UFS formatted volumes, then you would prepare the new disk using gpart(8) and newfs(8), and then you would use sysutils/clone or net/rsync to create an exact copy of the whole file system on the new disk. For this you would need to connect the new disk to the old server either on a free SATA bus or by the way of a USB enclosure you may plug it into a USB port. Please note, that FreeBSD got still some problems with USB3. And if your old server is pre-11, then you don't want to even try it.

In case we are talking about ZFS, then you need to ask the ZFS experts for the proper way of cloning a ZFS disk.

In any case you would need to adjust the copy of /etc/fstab for the device names (or labels) of the new disk. And as SirDice mentioned, it would be best to run a final mysqldump(1) right before you take the old server offline. So you would be able to restore the final state on the new server.
 
Oh, and as this system is considered "crucial", don't settle on a single replacement server. Replace it with two servers and configure a proper HA solution. Even that brand new server can develop hardware errors and you also need to take it offlline regularly in order to update it.

If your boss starts moaning about costs ask him what it would cost his business if that brand new server caught fire and burned to a crisp.
 
If your boss starts moaning about costs ask him what it would cost his business if that brand new server caught fire and burned to a crisp.

I use the same question with customers when designing them a shiny new large Juniper or Cisco network. That usually works with smart people. ;)
 
Back
Top