Submitted by amityweb on Tue, 11/05/2013 - 14:10
Please see this forum post: http://virtualmin.com/node/30999#comment-124142--
I copied a virtual server from one server to another using Cloudmin. Then on the target system I renamed the domain, username, password, etc. to make it a new server.
When I go to move the same server again from the source to target server, it says:
"Failed to update Virtualmin domains : The selected domains cannot be moved : The domain mydomain.co.uk already exists on the target system"
But as stated the domain on the target system has been changed, and the username. I cannot see a reference to the domain I want to copy anymore.
Status:
Active
Comments
Submitted by JamieCameron on Tue, 11/05/2013 - 15:04 Comment #1
If you search for that domain in Cloudmin (at Virtualmin Settings -> Virtualmin Domains), does it show as being on the target system?
Submitted by amityweb on Wed, 11/06/2013 - 04:03 Comment #2
It shows the domain on the source server as expected, but thats all. It does not list it on the target server.
Submitted by JamieCameron on Wed, 11/06/2013 - 11:01 Comment #3
I had a closer look at this, and it seems that the real reason is that a domain with the same Virtualmin unique internal ID already exists on the target system.
What was the history of this domain? I'm surprised that two domains with the same ID could exist on two different systems.
Submitted by amityweb on Wed, 11/06/2013 - 12:30 Comment #4
Its a virtual server we have a default website on it we use to clone to make other websites. I cannot recall how this virtual server came about, it is totally possible it originally existed as a customer website on another server (maybe even the target server), moved to the server it resides on, and we are trying to clone it back. Although why is its ID maintained when moving around, shouldnt it be given a new ID when moved to a new server, because if this clash issue? And when moving shouldnt it be checking the domain name exists not ID?
Submitted by JamieCameron on Wed, 11/06/2013 - 18:18 Comment #5
So was this domain created on a VM that was later cloned? That would explain why you could end up with multiple domains with the same ID.
At the moment this is a limitation of Virtualmin - once a domain is created, it always keeps the same ID even if backed up and restored.
Submitted by amityweb on Thu, 11/07/2013 - 02:43 Comment #6
Yes it would have been a new virtual server created somewhere but I cant say what server, we occasionally move sites to different servers because we use other websites as a basis to develop new ones.
What I would expect is when I move a server it allocates a new ID relevant to the server it is being moved to. What format is the ID in? Because if its just some sequential number like 1, 2 etc. then there is a huge possibility the ID will exist on other servers.
If I clone a server, will it create a new ID then? Because I can get around this bug by cloning the site, then moving that, IF the clone creates a new ID. And what if that ID exists when I move the new cloned site to the new server?
Submitted by JamieCameron on Thu, 11/07/2013 - 13:28 Comment #7
Yes, cloning will allocate a new ID. So you could get around this by cloning the site and then moving it.
Submitted by amityweb on Thu, 11/07/2013 - 15:16 Comment #8
But could the ID exist on another server? Or is the ID unique to that server or date/time or something?
I think moving a site to a new server should give it a new ID.
Submitted by JamieCameron on Thu, 11/07/2013 - 17:34 Comment #9
The generated IDs should be globally unique, as they are a combination of a timestamp, PID and random number.
I will look into an option to have a restore / move generate a new ID.