System 'remembers' deleted virtual servers

I am trying to migrate a domain from Server A to Server B. Server B is a brand new Virtualmin installation.

  1. I created example.com on Server B by restoring from a backup from Server A. All went well, but the customer was not ready for the transfer to go live.
  2. Customer is now ready to go live and so I took a fresh backup from Server A and deleted the first installation of example.com on Server B.
  3. I checked that no Virtual Servers were listed on Server B and so the initial installation had indeed been deleted.
  4. Then I tried to restore my new backup to Server B but the system wouldn't let the restore run, telling me that I already had a server called example.com installed on Server B.

All suggestions most welcome! I could uninstall Virtualmin and re-install it theoretically, but as this is a process that I am likely to need to repeat once Server B has gone live, it might work for this one customer it won't work again for any future customers.

Status: 
Active

Comments

Howdy -- just to verify, if you look at the domain drop-down list on the top-left, do you see the domain name listed there any more? Or is it removed from that list?

If I click on List Virtual Servers, I get 'No virtual servers have been created yet', but if I try and do the restore, then it tells me that the server already exists.

Try deleting all files matching /etc/webmin/virtual-server/map.* and see if that fixes the issue. These are cache file that map domain names to IDs.

Thank you. That worked, but strangely I noticed that every map.* file was 0 bytes so even though there was nothing in the files, somehow the cache was still working. Presumably there is only one set of map.* files for all virtual servers? If that's the case and the same issue should arise again once the server has gone live, then we will have a problem I guess. Perhaps a more rigorous clearing on the cache is needed when a server is deleted? Thanks again for your help.

I spoke too soon. This time, the restore initiated, but this time, this happened:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Starting restore of 1 domains from local file /tmp/.webmin/backup(2).tgz ..

Extracting backup archive file .. .. done

Re-creating virtual server hambro-art.com .. .. a clash was detected : The DNS domain hambro-art.com is already hosted by your DNS server

.. failed! See the progress output above for the reason why. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx How do I fix this please?

Ah, it sounds as if maybe some services have references to your domain even if Virtualmin doesn't.

For BIND, you may need to delete the zone in /etc/named.conf, and the associated zone file in /var/named.

Thank you. I found the relevant entry that you mentioned both in etc/named.conf and the file in var/named and have deleted them. Will try to restore from the backup shortly. Shouldn't the software either clear these out when you delete a VS or, alternatively give the user the opportunity to overwrite when trying to restore though? Many thanks for your help.

Yes it normally does delete that, it sounds like something went awry somewhere unfortunately.

Let us know if you're able to restore a backup now that you've removed those!

Well, I ended up doing something a little different in the end. I used the 'Transfer Virtual Server' option which seemed to work very well, there is a 'but' however. I chose the option to overwrite the destination server, and that more-or-less worked. Before the transfer I had created a test email user, and after the transfer that user was no longer listed, which suggested to me that the overwrite had worked. I wanted to continue using the test user after the transfer though, so I tried to recreate it, but the system wouldn't let me. It said 'Cannot create user: Directory /home/domainname/homes/seb already exists'. Just thought you should know that even if you do ask the system to overwrite the destination, then an existing user in the destination that is not present in the source, fails to get removed. All the best...

As a quick fix, you can avoid that problem by selecting the option to delete missing files on the transfer form.