This is an old revision of the document!
Documentation: https://www.virtualmin.com/documentation/system/migrate
Verify you have the ability to change the name servers at the domain name registrar. If you do not have this access, you will have to coordinate with someone who does.
When you migrate the domain to a new Virtualmin server, you will probably migrate to new DNS servers as well.
http://blog.rimuhosting.com/2011/04/15/migrating-vps-with-virtualmin-multiple-dns-changes/
Lower the TTL well in advance of your migration:
virtualmin modify-dns --all-domains | --domain <domain> --ttl <seconds>
You may want to edit the existing virtual server before migrating it to shorten the migration time and avoid migrating junk.
Virtualmin → <domain> → Server Configuration → Transfer Virtual Server
Sometimes you have to fix things before the migration will complete. If problems occur, they are usually during the backup stage.
Sometimes you will have problems with sub/alias domains. It can be helpful to make them top level virtual servers, then transfer them separately.
For an alias: Virtualmin → <domain> → Server Configuration → Convert to Sub-Server
Then: Virtualmin → <domain> → Server Configuration → Move Virtual Server → Convert to Parent
Sometimes, you have to 'disassociate' a feature in the Virtualmin configuration, perhaps when the feature was already deleted, but Virtualmin thinks it still exists:
virtualmin disable-feature --domain name | --user name | --all-domains [--disassociate]
Make sure the web server restarts after migrating a domain. Sometimes, old bits get carried forward and will keep the web server from starting!
You may need to reboot the host server to check that Apache restarts properly!
This will strip some old PHP settings from the new Virtualmin host server that will keep Apache from starting:
sed -i '/php_admin_value/d' /etc/apache2/sites-available/* && sed -i '/php_value/d' /etc/apache2/sites-available/* systemctl restart apache2.service systemctl status apache2.service
On the new Virtualmin server, check that the default web site has not changed:
Virtualmin → Server Configuration - Website Options → Default website…
Also check:
If the DNS slave server is not correct, delete any duplicate domain configuration on the slave server, then re-add the newly migrated domain to the slave DNS server:
virtualmin modify-dns --all-domains --add-all-slaves
Lastly, reset the DNS TTL after verifying your DNS is all correct.
virtualmin modify-dns --domain yourdomain.tld --ttl 14400
or
virtualmin modify-dns --all-domains --ttl 14400
In virtualhost mode, Apache does not specifically support a 'default' site. It will serve the first match alphabetically of the sites in
/etc/apache2/sites-enabled
. Virtualmin Pro uses this to configure the default site.
The Virtualmin installer disables the
000-default
site, but you can do so manually:
a2dissite 000-default.conf
In Virtualmin Pro, you can force a site to be the default site:
Virtualmin → <domain> → Server Configuration → Website Options → Default website for IP address?
Some important info below may be out of date
Webmin → Networking → Network Configuration → Hostname and DNS Client
mkdir /root/backups virtualmin backup-domain --dest /root/backups/ --all-domains --all-features --newformat --all-virtualmin
Use rsync
to copy the data to the new server:
rsync -avr ~/backups root@<newserver>:~
This will:
virtualmin restore-domain --source /root/backups/virtualmin.tar.gz --all-virtualmin virtualmin restore-domain --source /root/backups/ --all-domains --all-features