How to import many local virtual servers under Virtualmin control

Hi!

First a short story behind this issue:

We are using Webmin+Virtualmin on many servers (great panel BTW).
A week ago we had our “tech” weekend when patches and updates are installed.
When running upgrade on one server using Virtualmin update panel, system (Debian 7) went
to some funny state resulting Webmin and Vitualmin were completely uninstalled - including all
settings, scripts and acls (Hahaha!).
unfortunately I dont have more details right now (we are still investigating this).

Box (hosting for about 1.000 domains) is now in following state:

  • All websites are still up and running because we were able to finish upgrade of all other services (apache, php, MysQL, ProFTPD, Bind, etc…)
  • I installed Webmin from .deb package, then Virtualmin as .wbm package. installation from .deb package failed because of error “script was not run in full path”
  • Then I finished Virtualmin post-installation wizard

Now I assume these will be the next steps:

  1. re-create server templates and plans
  2. Import virtual hosts back under Virtualmin control - Here the real fun begin :slight_smile:

! Important note, server was originally installed using virtualmin install.sh script, so all dependecies and prerequisites should be ok.

there is a “import virtual server” feature allowing to import single server. Ok and what about importing almost 1.000 local servers? :slight_smile:
Is there any “best practise” how to achive this using a script? Do anyone have experience with this?

thank you very much for any kind of help or advise!

With regards, Jiri

Hello,

really no one has an idea or hint :confused:

Howdy,

Hmm, the Virtualmin .deb should actually install in your case, I’m not entirely certain what that error you shared is. You’d also want to make sure you have the Virtualmin theme installed though.

However, as far as how to get things working again – what kind of backups do you have?

Do you happen to have backups of all your Virtual Servers? Do you have a backup of the Virtualmin settings, which is typically within a virtualmin.tar.gz file?

And I don’t imagine you have a copy of your original /etc directory, do you?

Hello,

thank you for reply.

Error during Virtualmin .deb package installation - you are right. Issue was, that webmin virtualmin theme was not installed before .deb Virtualmin package. Its good to know this.

Backups - Another fun comes there: There are no backups :slight_smile:
It is regarding our Freehosting server, so there are no automatic backups scheduled. Each user can decide how to backup his virtual server manually using Virtualmin’s backup capabilities.

And of course there are no backup of /etc directory. We set up this kind of backup right after this incindet :slight_smile:

So, situation is:

  • all virtual servers are operational
  • webmin/virtualmin environment is configured again
  • We are able to import single virtual server back with all feaures and settings without any problem (server templates and plans are re-created)

So the only way I see is to write a mass import script which will handle all the work.
In order to do that, the big help would be to know what exactly is happening during single server import.
Which scripts under webmin/virtual-virtual-server are called in what order and what parameters are used?

This would be a BIG help for us. Of course we will be very happy to provide this tool to the community

I already tried to catch all related processess using some ps based scripts, but one have to be sure, because many things can go wrong there :slight_smile:

Thank you for another reply!
With regards,
Jiri

Howdy,

It’s good to hear you have backups now! :slight_smile:

As far as importing domain names – it sounds like we may end up needing to do that the hard way.

You can import a domain into Virtualmin, using Add Servers -> Import Virtual Server. Though I think you’re saying this already works.

It would definitely take some time to do that though…

Some of the Virtualmin functionality has a corresponding command line mode. Reviewing the command line functionality (which you can see by running the command “virtualmin”), it doesn’t appear there is such a thing for importing a domain like you’re trying to do.

I’ll ask Jamie if there’s a simpler way to do that when there’s many domain’s like you’ve got there. It’s possible he could create such a thing without much work, if it doesn’t already exist.

For example, if he added a command line option for that mode, that would make it relatively easy to script that.

I’ll get back to you shortly on that.

-Eric