I'm going to report this as a big because I dont think this should be the intended behaviour...
But when I clone a server, the new server database is named using the new server name appended to the old server name.
So for example, I have server1.mydomain.co.uk with database name server1, and I clone this to make server2.mydomain.co.uk. I would expect the new database name to be EITHER kept the same as the original (so websites using it would still work with no configuration still) OR renamed to server2.
Instead, what happens is the new database name is server2server1
This means not only do we have to change the website configuration, which is OK, it means we have to create a new database and copy all data from the old database into it, because no one would want to keep their database name as server2server1. if I clone that it would be server3server2server1
P.S. Not having a rename database feature makes this issue all the more a problem
Thanks
Comments
Submitted by JamieCameron on Thu, 12/12/2013 - 12:10 Comment #1
What I'd expect to happen is that the DB be cloned as server2 (it can't stay as server1, as MySQL doesn't allow multiple DBs with the same name).
Can you post the actual domain names and database names that this happened for, so I can see why the rename might have gone wrong?
Submitted by amityweb on Thu, 12/12/2013 - 15:12 Comment #2
My original domain was skeleton-ee.office.amitywebsolutions.co.uk and database ee-skeleton. I cloned this to make recigb.office.amitywebsolutions.co.uk and the new database was named recigbee-skeleton
Submitted by JamieCameron on Fri, 12/13/2013 - 00:22 Comment #3
Ok - can you also post the output from the following commands run as root on your system :
virtualmin list-domains --domain skeleton-ee.office.amitywebsolutions.co.uk --multiline | grep prefix
virtualmin list-domains --domain recigb.office.amitywebsolutions.co.uk --multiline | grep prefix
This will tell me what database name format Virtualmin expects for those domains.
Submitted by amityweb on Fri, 12/13/2013 - 03:58 Comment #4
[root@office ~]# virtualmin list-domains --domain skeleton-ee.office.amitywebsolutions.co.uk --multiline | grep prefix
Mailbox username prefix: skeleton-ee
[root@office ~]# virtualmin list-domains --domain recigb.office.amitywebsolutions.co.uk --multiline | grep prefix
Mailbox username prefix: recigb
Submitted by JamieCameron on Fri, 12/13/2013 - 11:12 Comment #5
Ok, I see the issue now - normally the default database for a domain is named to follow the first part of the domain name, so for
skeleton-ee.office.amitywebsolutions.co.uk
it would beskeleton-ee
. But if your case, it wasee-skeleton
, which confused Virtualmin's attempt to select a new name.Since this is pretty confusing behavior, I'll fix it in the next release.
Submitted by amityweb on Fri, 12/13/2013 - 12:20 Comment #6
If I ever stated "ee-skeleton", sorry this was a typo. It was always "skeleton-ee". So ignore "ee-skeleton" and assume "skeleton-ee". Sorry!
So not sure if your reply still stands, but I have clones two more sites today, and same things happened, the new name was added to the front of skeleton-ee for the database.
I have not tried cloning any other site other than skeleton-ee though.
Submitted by JamieCameron on Fri, 12/13/2013 - 15:05 Comment #7
Ok, this may have a different cause then.
Do these domains have more than one database?
Also, what is the output from
grep mysql_db= /etc/webmin/virtual-server/config
?Submitted by amityweb on Sat, 12/14/2013 - 07:27 Comment #8
No, skeleton-ee is the only database for its server
[root@office ~]# grep mysql_db= /etc/webmin/virtual-server/config
mysql_db=${PREFIX}
Submitted by JamieCameron on Sat, 12/14/2013 - 12:55 Comment #9
Ok, that also looks fine.
Can you try running the following commands :
ID=\`virtualmin list-domains --domain skeleton-ee.office.amitywebsolutions.co.uk --id-only\`
grep -e db= -e prefix= /etc/webmin/virtual-server/domains/$ID
ID=\`virtualmin list-domains --domain recigb.office.amitywebsolutions.co.uk --id-only\`
grep -e db= -e prefix= /etc/webmin/virtual-server/domains/$ID
Submitted by amityweb on Tue, 12/31/2013 - 05:27 Comment #10
Sorry for late reply, I've been quite ill this Christmas :(
Here you go. Although this website has an issue in that I cannot get a single line return. I enter it with single line returns they are all on one line, I enter a double line return and the double line return is output. So I have entered a double line return hence there are gaps which should not be there.
[root@office ~]# ID=
virtualmin list-domains --domain skeleton-ee.office.amitywebsolutions.co.uk --id-only
[root@office ~]# grep -e db= -e prefix= /etc/webmin/virtual-server/domains/$ID
prefix=skeleton-ee
db=skeleton-ee
no_mysql_db=1
subprefix=
[root@office ~]# ID=
virtualmin list-domains --domain recigb.office.amitywebsolutions.co.uk --id-only
[root@office ~]# grep -e db= -e prefix= /etc/webmin/virtual-server/domains/$ID
prefix=recigb
db=recigbskeleton-ee
no_mysql_db=1
subprefix=
Submitted by JamieCameron on Tue, 12/31/2013 - 15:00 Comment #11
Ok, thanks. I see the bug that causes this, and will include a fix in the next Virtualmin release.
Submitted by Issues on Tue, 01/14/2014 - 15:01 Comment #12
Automatically closed -- issue fixed for 2 weeks with no activity.