Migrate from Virtualmin to Virtualmin

I have a second (new) server. I want to migrate all domains from existing server to the new server. I didn’t find anything on the documentation wiki to cover this. I also tried searches in the forum, but either I’m not a great searcher (likely), or the topic doesn’t already exist…

Couple questions:

  1. Should I create a single virtual site before migrating any of the existing sites? (I.E. the server currently has zero sites).

  2. Is there a special order to migration?.

  3. Is there a batch migration option?

  4. I have some subdomains/subservers within the same home directory as the parent, and some as separate home directories.

So, what happens when I migrate the parent directory in those cases? What is the recommended way to move those domains, etc.

  1. The most basic question: How to do the migration, exactly? I.E.
    a) backup and transfer the backup?
    b) import on the new server?

When would I "turn off"/delete the site on the old server, in this case?

(I’d wish there was a single point to administer this on the NEW server, which would connect and migrate automatically, in a transaction)

Same question here im migrating to a new server from FC3 x86 to Centos5 x64
And with all the diff’s like mysql 4 /5 php 4 /5 etc is pretty hard.
But also with plain website it doesnt work that great to backup and restore what is the best way to do this ?
Maybe Joe can give a write up on his thoughts…

Howdy,

I just did something similar! A few thoughts –

tabletguy wrote:

1) Should I create a single virtual site before migrating any of the existing sites? (I.E. the server currently has zero sites).

So long as you have a decent way to get to your server, I’m not sure it matters that you have a site setup there.

2) Is there a special order to migration?.

There shouldn’t be. If there is, it’s likely a bug – save the backup file so you can give it to Jamie and allow him to fix it :slight_smile:

If you run into an error importing one of your virtual servers, simply skip that one and go back to it later, it might just work once everything else is done.

3) Is there a batch migration option? 5) The most basic question: How to do the migration, exactly? I.E.

Where I would start is to perform a normal backup of your Virtual Servers. I like the "One file per server" option (which creates a tar.gz file for each domain you have hosted there).

When you’re done, you’ll have a directory full of tar.gz files. Copy that entire directory to the new server.

Then go into Webmin on the new server, choose "Restore Backup", and point it to the directory full of your tar.gz files.

At that point, it will give you a list of what all it plans to do during the restore.

4) I have some subdomains/subservers within the same home directory as the parent, and some as separate home directories.

I suspect you’ll be fine here, but you might need to give it a shot and find out :wink: You don’t need to make it live until you see things working.

So, what happens when I migrate the parent directory in those cases? What is the recommended way to move those domains, etc.

If you’re able to, I might recommend doing it all at once (ie, perform the backup of everything, copy, restore).

When would I "turn off"/delete the site on the old server, in this case?

I’ll offer the steps I used for my migration, I think that might help answer your question:

  • Warn users that stuff is moving :slight_smile:

  • Lower the DNS TTLs so prevent DNS from being cached for too long (the $TTL number at the top of each domain.com.hosts file)

  • Backup Virtual Servers

  • Copy Virtual Server backups to new Server

  • Restore Virtual Servers

  • Log into Webmin on the new server, and for each Virtual Server, click Services -> View Website via Webmin, in order to verify that each site is working (remember, the sites aren’t live yet, but this Webmin feature allows you to see them even when not live)

  • Once things appear to be working reasonably well, log into the registrar and update the "glue records" – that is, make sure the IP address assigned to the nameservers being used is pointing at the new box, rather than the old one

  • Put the DNS TTL’s back to normal

I wouldn’t get rid of the sites on your old server for at least a few days after the transition. Some folks may still be hitting your old server for a few days since DNS records are cached, it may take a bit before everyone is hitting the new server. Lowering the DNS TTL’s should help with this, but still… :slight_smile:

Also, how well the above works depends on how much stuff you need to transfer and how long that transfer will take. If you can do all that in a few hours in the middle of the night, that’s one thing – but if it takes days, you might want to consider running rsync after the restore to pull over anything from /home on your old server that may have changed since you performed the backup.

There’s also the option of migrating one Virtual Server at a time, but I personally find that cumbersome :slight_smile:

Good luck!
-Eric

Thanks for the response.

One more aspect of the migration (or perhaps a couple)

There are other settings (customized letter formats, custom defaults, etc) for Virtualmin, as well as customized Squid settings and firewall rules.

Is it possible to migrate all of those items (maybe cron jobs as well).

Most of the above was setup by other than me, and some by installs (optional steps outside of Virtualmin scripts).

As I think I understand virtualmin & webmin little bit I think that everything is written into $prefix/etc/webmin configuration files (for webmin and virtualmin) - you can inspect this folder and move necessary configuration files (but I don’t think it is neccessary) - other files are configuration files for each server (like Squid, Apache, ProFTPd etc.) and webmin is parsing them and writing configuration into them instead of admin hands. So if you will move those configs onto your new server it should work cause newer versions of software should understand older config files.

Of course there are rules like BACKUP EVERYTHING and TEST IT WELL. If you are moving on new server I think that there may be no problem with this as you can undo whatever you did and try it again. When you will be ready with you new setuped server you may start with changing DNS records. Maybe there can be a problem with TTL as been mentioned before if you have many users and they are changing site contents often - but this can be solved by lowering TTL for DNS records to minimum and than writing something - site is moving to new one into each website on old server for those people whom will come to old server.

I did quite a couple of these virtualmin to virtualmin migrations in the last couple of month and often had problems, though all server were the same OS (Debian w. apache2, postfix, mysql).

My hint if things fail: turn an option off an back on. Make sure you have identical templates. Do serious testing (esp. w. mail accounts)

I would very much appreciate a feature that eases V2V migrations and which checks when don, that REALLY EVERYTHING is transferred, in place and working.

H.

Can anybody confirms that this how to work? By the way… Joe, do you have official how to on migrating virtualmin to another virtualmin box which is newly set-up using the install.sh? Hope to hear from you. THanks.

I did quite a couple of these virtualmin to virtualmin migrations in the last couple of month and often had problems, though all server were the same OS (Debian w. apache2, postfix, mysql).

File bugs! We can’t fix it, if we don’t know it’s broken.

It works in our tests…so we need you to tell us when things don’t work.

So joe… you confirmed that andreychek how to works in your test, right?

andreychek is usually smarter than I am. You can trust his advice, generally, and if not, I’ll usually amend or correct. I see nothing to complain about in this howto.

Since I have far fewer sites to move than some folks, I usually do make the move one virtual server at a time, which means I can focus on making sure everything is right for each one. But, it’s merely a matter of order of operations, not any particular right or wrong.

Joe, how to do this?

"Lower the DNS TTLs so prevent DNS from being cached for too long (the $TTL number at the top of each domain.com.hosts file)"

Thanks.

PatrickLambooy wrote:

I did quite a couple of these virtualmin to virtualmin migrations in the last couple of month and often had problems, though all server were the same OS (Debian w. apache2, postfix, mysql).
File bugs! We can't fix it, if we don't know it's broken. It works in our tests...so we need you to tell us when things don't work..

Hey, 1 year + w. no need to move Virtualmin :slight_smile:

The problem I had today is w. templates.

On the old box the template all virtual servers were created with is … lets say "xyz" now, on the new box I created "xyz" as clone from the default template and compared/adjusted all settings to be as on the old box.

When I restore the backup, it shows all virtual servers that will be imported (and created), but when I hit Restore Now, I get:

[code:1]Starting restore of 128 domains from local file /root/backup.xyz …
Extracting backup archive files …
… done
Re-creating virtual server domain.com
… the server template specified in the backup does not exist
… failed! See the progress output above for the reason why.[/code:1]

How can I transfer the template from the old to the new server?

Cheers!

There may be a better way than what I’m about to suggest. But, I also suspect this will work just fine :slight_smile:

It looks like the templates are stored in this directory:

/etc/webmin/virtual-server/templates/

The various files in "domains" reference those templates by their filename.

By copying over the files in the templates directory, that should handle the error you’re seeing above.
-Eric

thanks a bunch, Eric, that worked perfectly! :slight_smile:

Though the restore ended w.: "… failed! See the progress output above for the reason why.", no errors were shown and a option "Validate Virtual Servers" reported that everything is o.k.

I reckon the developers should take a look at V2V Transfers resp. V2V Migrations, cheers!

Hans

I don’t know if this will be a thread resurect or high-jack & if it’s a problem if I do so.

But, I am going to state clearly what I’ve inferred is the process :
On my old Virtualmin server : 3.48 gpl. I save a backup & ssh it right across to my new server.
Then on new server I run the restore backup option, tell it which file to grab & it seemed to do what I was hoping it might do.

I have 2 concern’s with this process, 1) I have one user with about 60GB worth of data. It’s all on an internal network, so moving it isn’t a huge problem w/cost’s or speeds, but I was wondering if I could backup just the config, but not the home folder, & then Rsync the data myself. -Is there a better way? or is that what others do?

I thought I’d try that with another site & right now it seems to hung at the “updating webmin user” section of the Restore. - I guess that’s my secdond thing.

Another migration issue that was not obvious to me, anyways, was a move from Apache 2.0.xx to Apache 2.2.xx Some of the Mod Rewrite handling in .htaccess changed. (I’m sure many other things changed too, but this is one that specifically had subtle effects for me).

Because of that change, one version of a URL rewrite stopped working, redirecting to the base URL instead of the blog URL when the "www" was removed, while other versions continued to work. It happened to be with Wordpress blogs, so that a large number of incoming links were "broken" for a couple weeks.

So, part of testing should be to check things like this, and if you have an analytics package (Google, others), to monitor them for changes.

In this case, I moved 3-4 sites every couple days, which let me run some tests for each site. One site in particular I had to switch back twice for various reasons.

I do VM -> VM moves as part of my business using the VM2 module which really does a wonderful 99.9% of the time. The only thing I usually check is the templates/plugins and make sure they match after that I simply do a move from the old server directly to the new one using SSH and only disable the site on the older server.

50 domains takes about 6 hours to totally move and make sure they are operating correctly.

By VM2, what do you mean Sgrayban?

My imported user mentioned before… never seems to have imported correctly. I try loggin in now & check the Virtual server for the user settings I restored & it causes my VM interface to seem to crash. When I type TOP while ssh’d, Perl seems to be taking over the system.
Is there a command-line way I can undo this restore?

By VM2, what do you mean Sgrayban?

Scott’s talking about Virtualmin Machine Manager, which is a tool for mass server management (including virtualized and dedicated servers, both with and without Virtualmin). It is currently in private beta with a few of our larger customers–folks who have more than a few Virtualmin systems.

You can perform migrations without VM2, but it does make it moderately simpler. There will be a low end version of VM2, with no virtualization support that I believe will be priced at $198. I hope to launch it publicly in a week or two.

Joe, what do you mean by W/o virtualization?
Not to confuse the definition of virtualization, but do you mean virtualized OS/hardware, the whole 9 yards that my little GPL version doesn’t do? (that I am aware of i.e. xen, VMware) Or do you mean the virtualization existing GPL user’s are using/used to.

I haven’t looked at the full feature spec’s of the Pay V-min since it became for profit, didn’t know it did full on Virtualization.

Well, the “restore” I did seems to have caused a problem. (mind you, I know it was a screwed up backup I made to begin with) I think it’s responsible for my box repetitively crashing now. I’ve got to kick the reset button & see if I can fix it via SSH, because I cannot get Virtualmin to even display the config web-terface if I choose that user.