Transfering entire server to new hardware-best way?

11 posts / 0 new
Last post
#1 Fri, 12/17/2010 - 06:33

Transfering entire server to new hardware-best way?

If I about to move entire webserver with all settings, etc to a new hardware - what is the best way to do it?
Backups I do:
1) entire filesystem backup
2) domains backup (1 file per domain with all settings, etc)
3) webmin/virtualmin settings backup

Fri, 12/17/2010 - 07:36
ronald's picture

On the new server:
Install your favorite OS, compatible with Virtualmin (like Centos)
Install Virtualmin by
Adjust all settings to your demands
Make sure the server is running as expected
Import / restore your domain-backups over the shell from server to server.
Check with preview websites if all is fine.
Adjust the domain ns records or A records at the registrar for all domains.

In my experience fastest and most secure way.
The only downtime you may suffer is due to propagation for the new IP's but it will be limited as you have both servers up for a short while.

Fri, 12/17/2010 - 08:01

yes the idea to transfer everything and have exact same OS Centos, so you wouldn't recommend restoring it from filesystem dump then?

Fri, 12/17/2010 - 08:11

Filesystems dumps are tricky when dealing with live servers -- you'd need to make sure all the data on the server were consistent.

I actually think it's a bit easier to just perform a clean install, copy over your Virtualmin backups, and import them.

Also, remember that the file virtualmin.tar.gz (generated with the rest of your backups) contains all your Virtualmin settings, server templates, backup scripts... you'd want to restore that as well if you wish to keep your current Virtualmin settings.


Fri, 12/17/2010 - 08:12

great, thanks a lot guys!

Sat, 12/18/2010 - 13:29

I agree with Eric there!

Exception might be if the new server has identical hardware. In that case you might create a complete filesystem image using an external tool (not while the server is running!), e.g. boot Acronis True Image from a CD, and restore that image to the new server. That would be the fastest way, but only works in case of identical hardware.

In all other cases, doing a clean install and restoring domains using Virtualmin is, like Eric said, probably the least glitchy way. :) And also quite fast, thanks to the automated installer and the option to restore all Vmin settings along with the domains.

Concerning Vmin settings: note that you need to separately turn on backup of those... By default, backing up Vmin settings is not checked when creating a backup (schedule).

Mon, 12/20/2010 - 11:06

Hey guys, I want to do this exact same thing... I'm working with three machines here...

Suppose I have machine names ns1, ns2, and NONAME.

On NS2, under Virtualmin - Backup and Restore - Scheduled Backups, I nightly backup all domains, and all features onto NS1 as /ns2_backups/ns2_backup.%A

Also on NS2, under Webmin - Backup Configuration Files, I schedule a backup of all modules, webmin configuration files, and server configuration files onto NS1 as /ns2_backups/ns2_webmin_backup.tar.gz

So now I built NONAME with which I want to replace ns2. ns2 is running Redhat and I know that's a no-no so I want to load it onto NONAME which is running Centos... I want NONAME to become ns2.. same IP addresses and domains, associated with the same databases and user account... yikes...

Do I simply set NONAME to use DHCP at first, then import the backeup settings from ns1 OR do I setup NONAME as ns2 with the correct IP addresses intially, then import the backup settings? In which case I have to turn the current ns2 off, set up NONAME as the new ns2, import the stuff from ns1 onto the new ns2, make sure all is well, and if not, turn off the new ns2 and turn on the old ns2... I hope that make sense... can't run both ns2 machines at once.

Finally, in what order do we import the backed up files? Webmin configuration first, then virtualmin backups? Or vice versa?


Mon, 12/20/2010 - 14:37

so there is no point of making COMLPETE filesystem backup then, unless hardware is identical?

Mon, 12/20/2010 - 19:43

Well, as Eric and me outlined, filesystem dumps are most useful for backup purposes, not for migration, and need to take the problems of "open files" (databases, log files, web files being modified) into account.

For migration to a new server with different hardware I'd use the approach "backup vservers via Vmin, install fresh, restore backups" approach. Of course, you can try both methods and see what works better for you.

Wed, 12/29/2010 - 20:46 (Reply to #9)

Unfortunately, you will find not all settings do come over when you restore the VMIN backup. I've found dozens and dozens of settings that do not restore. Simple example - postgrey is not enabled, if it was, and, any IPS or servers you added to the list are long gone. Sender canonical is gone, etc. etc.

Still trying to find a reliable way of doing this, my interest is not really moving servers, but, using an existing "perfectly" setup vmin installation to create a new machine with no virtual servers. No as easy as it seems thus far.

Thu, 12/30/2010 - 01:37
ronald's picture

if you would have identical hardware then you could do this with making an image (think clonezilla). Then remove the vservers over the command line. Adjust IP and hostname settings on the new machine.
Even if the hardware is not identical, you could try this method as Linux is pretty smart.

the whole process would take less than an hour. I have done this numerous times.

Topic locked