Move Virtual Server from Virtualmin on one VPS to Virtualmin on another VPS

Hello,

In my exuberance I now have several Virtualmin installations on different VPSs. I would like to be able to move a virtual server from one installation to another. I looked over the options in Virtualmin and I do see the option to import a virtual server. But I also see the options for backing up and restoring virtual server too.

I am not clear on the best way to do this transfer, and I have not been able to find anything by Googling so perhaps I’m not using the right terms.

I would appreciate any advice on how to move the virtual server.

Thanks.

Howdy,

My recommendation would be to just generate a Full backup of that Virtual Server, copy that to the other server, and then import it.

From there, you should just have to update the nameservers for that domain so that they use the nameservers associated with the other server… and then you should be good to go!

-Eric

Yep, what Eric said. I’ve migrated a ton of VS already using that method.

I recommend setting the TTL of the domains being migrated to like 60 seconds a while before, so that downtime due to nameserver caches is minimized.

In case I did it wrong or I am not understanding, I restored a backup that I made of a virtual server on VPS A on VPS B, not imported it. That distinction seems important as both options are available in Virtualmin, and which to use was part of my original confusion.

I could not get the import function to work. Virtualmin would not recognize my backup file as a domain backed up by Virtualmin. All I ended up with was a shell, the structure of the domain, but not content, no files imported.

I did have the nameserver lag as I had made the backup before I had the benefit of your post. In future, I should change the TTL settings in Virtualmin for the domain being transferred to 60 seconds before I make the backup?

“Restore” would be the correct function to use, yes.

(“Import” is to bring an existing domain under Virtualmin control, and “Migrate” is for importing backups of 3rd-party control panels.)

From a DNS standpoint, it doesn’t really matter if you change the TTL to 60 seconds before or after you take the backup. During restore, the BIND zone will be created with default TTL anyway, and the 60 seconds setting is only to make sure that, when you do the actual switch, nameserver caches won’t retain the old IP for too long.

So after you switch to 60 seconds, you should wait for the old TTL value to pass, to be sure that no cached versions of the old IP with the longer TTL are still present. Then you do the switch-over.

I have been looking through dozens of “server migration” threads here, and can’t help but noticing that the tips here are much more detailed than the current migration guide at: http://www.virtualmin.com/documentation/system/migrate

So we either need to update that, or provide a way that allows users to contribute to it, or streamline the whole process.

and I was wondering how difficult would it be to come up with a “migration” module that goes through the most essential steps in a “wizard” fashion, i.e. setting the TTL for all domains accordingly, creating backups and moving them to the new server via SSH ?

Ideally, such a wizard would also have some concept of a website-specific test suite, to test features like DNS, mail, mySQL and apache.

In the case of databases like mySQL, the old server could even use it remotely during the migration, to ensure that the websites write new data to the new server.

+1
Good idea!

Eric, Jamie? There’s something for your to-do-and-make-users-happy list. :wink:

There are quite a few pitfalls that could be addressed by such a module - otherwise, people need to read dozens of threads here, e.g. see:
http://www.virtualmin.com/node/31025#comment-124343
https://www.virtualmin.com/node/27370#comment-117551

to name just two undocumented “pitfalls”.

the forum itself has a ton of good migration related discussions, but there are also external websites/blogs covering “best practices”, and it would be really awesome if this could be turned into a dedicated virtualmin module that walks people through the whole migration process using some step-by-step wizard.

http://penguinbliss.wordpress.com/2013/10/30/mass-migration-between-virtualmin-servers/

I would also assume that this could be a very interesting feature for professional users, i.e. the cloudmin guys. And I would in fact consider getting the professional module if wizard-guided migrations could be supported out of the box.

It seems the idea already came up a while ago: http://www.virtualmin.com/node/22911#comment-103694

Howdy,

A similar feature actually does exist in Cloudmin Pro – there’s a button you can press to migrate domains from one server to another.

I’ve added it to my notes to bring up the idea of adding such a thing to Virtualmin though :slight_smile:

-Eric

That’s good! IMO it’d be overkill to install Cloudmin just for that feature. :slight_smile:

So the feature basically exists already, and all the building blocks are already there ?
that’s great news!