Submitted by sebholmes on Wed, 01/25/2017 - 16:49
I am trying to migrate a domain from Server A to Server B. Server B is a brand new Virtualmin installation.
- 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.
- 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.
- I checked that no Virtual Servers were listed on Server B and so the initial installation had indeed been deleted.
- 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
Submitted by andreychek on Wed, 01/25/2017 - 22:17 Comment #1
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?
Submitted by sebholmes on Thu, 01/26/2017 - 01:06 Comment #2
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.
Submitted by JamieCameron on Thu, 01/26/2017 - 19:24 Comment #3
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.Submitted by sebholmes on Fri, 01/27/2017 - 01:56 Comment #4
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.
Submitted by sebholmes on Fri, 01/27/2017 - 01:57 Comment #5
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?
Submitted by andreychek on Fri, 01/27/2017 - 09:40 Comment #6
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.
Submitted by SebH on Wed, 02/01/2017 - 06:43 Comment #7
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.
Submitted by andreychek on Wed, 02/01/2017 - 08:23 Comment #8
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!
Submitted by sebholmes on Mon, 02/06/2017 - 03:28 Comment #9
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...
Submitted by JamieCameron on Mon, 02/06/2017 - 15:15 Comment #10
As a quick fix, you can avoid that problem by selecting the option to delete missing files on the transfer form.