# Server relocation



## nanotek (Jan 24, 2014)

What's the simplest way to transfer a server to new hardware? That is, I want to relocate my whole home server -- base system, jails, services, data, everything -- to a new PC (with the same architecture just more disk space and RAM) without too much hassle. Basically, take an image of the entire system and restore it on the new box. The new system already has 10.0-RELEASE (as does the existing server) and both are on the same LAN.

I was looking at Clonezilla, but I've never performed this type of operation before and thought, as with most things, FreeBSD might already have the tools needed to do the job without third-party programs and do it better.


----------



## SirDice (Jan 24, 2014)

If it's already running FreeBSD why not only copy the data? I'm not sure how old the old system was but if it's anything like mine I'm sure there's a lot of needless crap on it. Just moving the data to the new server will give you a nice clean start again.


----------



## nanotek (Jan 24, 2014)

As in, just tar everything and copy it across the network then untar it? There's likely a fair bit of fat to be trimmed, but I've been pretty conservative as resources were limited on this older box. I thought cloning/taking an image and restoring would be quicker and less manual labour than copying the data. I'd need a list of everything needed to completely emulate the existing setup on the new system, or would you suggest just tar-ing each partition (/ /var /tmp /usr)?


----------



## SirDice (Jan 24, 2014)

Just leave the old server as-is for the time being, you can use it as a reference. Look at the packages that are installed and install the same ones on the new server. Configure each bit one by one using the old server as a guideline. You can then just copy the data, like /usr/home/ for example. Start using the new server, if you find something missing you can still look it up on the old server and copy it.


----------



## nanotek (Jan 24, 2014)

I was hoping to avoid all the compiling and configuring. I suppose, given there's no rush, I could install what's needed and copy the configuration files over when done. Make sure everything is running smoothly than transfer the data over too. Good idea, thanks.

For future reference, what is the preferred image taking and restoring procedure? Could one `dd` a live system? I was just reading up on Frisbee, that sounds pretty good too.


----------



## ondra_knezour (Jan 24, 2014)

The dump()/restore() routine seems to be prefered amongst veterans and documentation.

You can dd live filesystem, but you will end with inconsistent copy, because of changes to the files during copy. Better one is copy of a snapshot, but still you will be caught by application level inconsistency - with snapshot you will have perfectly consistent files, but for example databases will be caught in the midlle of the transactions etc. So generally spoken, hot copy of filesystem is easy and will lead to disaster without proper examination of transfered system and preparation.

In situation you are describing I usually just place old disk into the new machine, boot from live media, mount what will be transfered, prepare partitions/filesystems on new disk and copy what is neccessary.

There is also recent thread here on the forum started by @vanessa about what to move to new system if you want to keep existing configuration, search for it.


----------



## nanotek (Jan 25, 2014)

Thanks, @ondra_knezour. I'll look for that thread and read up on dump/restore. As a last resort I'll pull the disk and place it in the new box but I'd like to gain the experience of cloning and restoring a system.


----------

