Submitted by PureLoneWolf on Mon, 08/17/2015 - 08:59
Hi there, I am in a little bit of a panic as I have just been informed that my VPS is being moved to a different box. The nice thing is that I get more disk space, RAM, CPU...the not so nice thing is that I have to backup and restore everything myself.
What's the easiest way to achieve this? Is it possible to take a full snapshot backup including OS etc...and then restore.
I have SSH, FTP, SFTP access to the device.
I have also asked to keep the IP address, but I don't know if that will happen..which is a pain as my box acts as a nameserver. :/
Hailp!!
Thanks
Status:
Active
Comments
Submitted by andreychek on Mon, 08/17/2015 - 09:09 Comment #1
Howdy -- sorry to hear they're making you move!
There's actually steps to perform a Virtualmin migration though, that should simplify the process quite a bit.
Directions for that are here:
https://www.virtualmin.com/documentation/system/upgrades-and-migrations
Now, that doesn't handle the OS, and packages that may have been manually installed after Virtualmin was put onto the system.
It also doesn't handle config file tweaks for all the config files in /etc (just the ones that are associated with Virtual Servers, such as Apache and BIND).
After performing your migration, just do some testing, and review your log files if you discover any issues. It should hopefully be straight forward as to how to resolve the issue.
If you have any problems you're not sure about, let us know and we'll review it with you.
How much time are they giving you to migrate?
Submitted by PureLoneWolf on Mon, 08/17/2015 - 09:27 Comment #2
I'm not sure I'm going to get any time. I have to backup, they will delete the old one and give me access to the new one.
I am looking at a baremetal type restore. Just install the OS on the new box and then restore from a full system backup.
Not sure if this would work, and am not 100% certain how to do this. Can I tar from / as root and then untar it one the new box?
I have asked for the same IP addresses (I have 2 for the nameservers) - Could this work? Any idea how to go about it?
Submitted by andreychek on Mon, 08/17/2015 - 09:38 Comment #3
We don't have any instructions detailing how to make a migration work using tar or rsync to move the entire installation, though in theory it can work.
If it's a remote system, rsync may be the simpler tool to use.
You'd want to start with the same distro/version on the remote system, then move all the files.
When doing that, you'd want to make sure that a minimal amount of services are running on both systems. Things like MySQL, Apache, Webmin, and such should be stopped if you're using tar or rsync to copy files.
Problems can occur when trying to perform a migration like that, so I'd do your best to work with your provider to make sure they aren't shutting down your old VPS quite yet.
I suppose I should ask, is there anything you can do to convince them to move your VPS?
From your provider's perspective, your VPS is just a single image file, and it should be possible for them to just copy the VPS image to the other system, and then resize it.
Note that before doing any of this, I would highly recommend making sure that you have a good Virtualmin backup of all of your domains.
I would also recommend having a backup of the entire /etc directory.
Submitted by PureLoneWolf on Tue, 08/25/2015 - 10:48 Comment #4
Hi there
They are giving me a whole suite of reasons why they can't move the image...none of them make sense, but that's the situation I am in.
I have bought a 2nd VPS and will cancel my current one when the migration is complete.
The plan is to rsync everything across. The new box will have the same version of Debian installed, but no services whatsoever (except the standard stuff).
How will this affect Virtualmin? I am not sure how it does license checking. Obviously for a short time, it will be running on both systems until the transfer is complete and confirmed, and the nameservers change to point at the new box..at which point I will delete the old one completely.
Would you know what files that the server IP addresses get hard written into? I just want to be able to rsync, edit and go..
Would there be a quick way, that any access to webservices on the old box could be pointed to a single - static - page that simply says "Server Migration in progress, please have a little patience"..so I will be able to tell when the new box is live.
Thanks :D
Submitted by andreychek on Tue, 08/25/2015 - 11:04 Comment #5
We're not at all concerned about the Virtualmin license during your migration. It's normal to have the license on two servers during a migration.
Note that it's been years since I've tried performing a migration using rsync, so I don't have exact steps for you. You may need to do some trial and error to get it working :-)
There's a handful of files you wouldn't want to migrate with the rsync -- /etc/fstab, /etc/network/interfaces, and any virtual directories such as /proc and /sys.
You would want to shut down services on the old server as well -- if nothing else, absolutely turn off MySQL (the copy won't work properly with it on), but the more services you stop the better.
Once it's complete, you can then go into Addresses and Networking -> Change IP Addresses on the new server, and there you can have it re-configure all the config files with the new IP.
Submitted by PureLoneWolf on Tue, 08/25/2015 - 14:26 Comment #6
Thanks :)
Is there a quick way, once the copy has taken place, to take virtualmin offline, so that I can just have a single, static, page displayed for all sites?
It would be useful for 2 reasons..the first being that DNS can take a while to propagate and I want to avoid new forum posts etc once the copy has been made. The second is that I will instantly be able to see when the DNS has propagated, as the sites will start loading again when everything starts resolving to the new IP.
Cheers Dave
Submitted by andreychek on Tue, 08/25/2015 - 15:08 Comment #7
There isn't a way built into Virtualmin to do that.
I suppose you could always remove all the Apache config files in /etc/apache2/sites-enabled except for one, and have that one be the static site you're looking for.
Submitted by PureLoneWolf on Fri, 08/28/2015 - 03:30 Comment #8
Hi again
We did an rsync between the boxes and everything seems to be running without issue.
One annoyance is when I click on System Information in Virtualmin, the System Hostname is MYHOSTNAME (OLDSERVERIP)
Can I change this somewhere?
Thanks
Submitted by PureLoneWolf on Fri, 08/28/2015 - 03:37 Comment #9
oops - Sorry, found it - Needed to update the hosts file
Submitted by andreychek on Fri, 08/28/2015 - 09:13 Comment #10
Great, I'm glad things are working well, and that you found the file to edit!