Finally found the reason for missing virtual servers, when we transfer the servers it'll overwrite if same id exists

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Usermin version 2.102
Virtualmin version 7.30.3
Theme version 21.20.7
Apache version 2.4.52
Package updates 2 package updates are available

Hello team,

finally was able to correlate the missing domain issue, whenever we transfer a domain from new server or restore from backup if the virtual server id matches with already existing server it’ll simply overwrite the existing server but I guess that is intentional to make incremental backups work.

If possible can we ask for confirmation before restoring a backup or before transferring a server to confirm the overwrite or create different id?

or if there is a better option available like comparing the domains if before overwriting the exisitng configs if different from backup create new virtual server configuation in /etc/webmin/virtual-server/domains.

That’s bug-like, and not at all intuitive. I’ll ask @Jamie to take a look. We should definitely protect against that.

1 Like

Are you still seeing this issue with the latest Webmin 2.402 and Virtualmin 7.30.8?

This is kind of expected actually - the domain ID is supposed to be globally unique, as it’s assigned based on the exact second of creation and the Unix process ID, so there should never be a conflict. Hence Virtualmin assumes that if a domain with the same ID already exists, it is the same domain and over-writing makes sense.

@naresh335 can you tell us more about your use case for how two different domains would get the same ID?

1 Like

Thanks @Jamie for the explanation.

In my case, however, the domain check only considered the ID and not the full domain name.

Here’s the use case:

We have a primary domain, example.com, and needed to create a mirror site at example.xyz for specific reasons. Both domains are hosted on separate servers.

Later, we needed staging environments for both sites, so we set up a new server and transferred example.com to it, renaming the domain to stg.example.com.

Subsequently, we transferred mirror site with it’s changes example.xyz to the same staging server (mainly for cost-saving purposes). Since all domains were initially cloned from example.com, the transfer overwrote the Virtualmin domain config for stg.example.com.

I understand this is a fairly unique and unlikely scenario for most users, so if addressing it requires significant development effort, I completely understand. I just wanted to share these findings in case someone else runs into a similar situation in the future.

Ok I see now. It should be possible to add an option to re-generate the ID when restoring a domain if there is a clash instead of over-writing, if the domain name is different. I will add this to my TODO list, and update this ticket with progress..

1 Like