Why web applications in cloned virtual server use DB of original virtual server?

In Virtualmin -> Server Configuration -> Clone Virtual Server window the following notice is given:

Warning - any web applications in the cloned virtual server will continue to use databases in the original virtual server until their configuration is manually changed.

I wonder is there any particular reason why any new cloned server can’t use new database and has to use database of original server? I probably wouldn’t happen on this matter for a long time if a user on my server didn’t actually cloned couple of servers and as a result only last cloned server was working while original one and first clone could not connect to DB. Because their databases had no users at all. Though they, no doubt, had users with correct permissions before cloning.

Howdy,s

Well, the issue is that when you clone a server, the web application on the original Virtual Server is cloned to a new Virtual Server.

That includes the config files for any web apps running in your original Virtual Server.

So, it’s not that web apps in your cloned Virtual Server can’t use their own DB – the above message is simply a warning that, out of the box – web apps on your cloned Virtual Server are using the same configuration file from the original domain, and thus are configured to use the original database.

To fix that, you just need to tweak the config file of web apps in your cloned domains to point to the cloned database.

-Eric

Thanks for the prompt reply. Yes I did fix by manually re-adding MySQL users to respective databases. I wonder is there any way not to do it every single time when a user decides to clone his virtual server, but to tweak this on a template level or somehow once and forever on Virtualmin’s conf?

This is currently being discussed in the tracker, see: http://www.virtualmin.com/node/31977