Change hostname

I have historically used Cpanel and was migrating from one server to another which runs Virtualmin.

To allow me to do the migration as seamlessly and quickly as possible (mainly I wouldn’t have to modify my HTML and PHP files when I migrated), I set up a virtual host on the new Virtualmin server with the same physical path setup as the old server (/home/domain-name/) and gave it a temporary domain name.

I then copied all the files and databases etc across and made sure everything was working. Once it was I changed my DNS (which is external) and manually edited httpd.conf and changed the domain name and so on under the virtual host to the correct domain name.

This all worked fine and the site is running absolutely fine on the new box as it should.

However, when I login to Virtualmin, in the dropdown for virtual hosts, I still see the old domain name and an error: Failed to query Postfix config command to get the current value of parameter virtual_alias_maps:

As a result, none of the Virtualmin menus show (Webmin all works fine) - I tried editing the virtual server in Virtualmin (it also says Edit Virtual Server In domain at the top) but there is no option to change the domain name.

I am assuming there is a virtualmin conf file somewhere which has this in it - how do I change the actual domain name in Virtualmin without deleting the virtual server or any of the content currently live?



Unfortunately, manually changing the domain name listed in the Apache config would confuse Virtualmin, and could cause it to think that the domain it’s hosting isn’t there.

To change the domain name of your Virtual Server – what you’d want to do is go into Server Configuration -> Change Domain name.

That’ll update all the config files, and make sure everything is in sync.