I found this instruction:
https://www.virtualmin.com/documentation/system/migrate
It’s simple and quick way to migrate sites to another server and I done it, however, the results are far from being perfect. I followed it to the letter and yet I encounter issues.
I was transfering 2 sites (2 virtual servers) and 1 subdomain (one sub-virtual server)
On the first glance:
- in preview sites cannot connect to a mysql database (why? it should create the same databases, users, passwords, the same config files)
- when I try to use phpmyadmin panel I get ERR_SSL_PROTOCOL_ERROR, so there is a issue with ssl, etc.
Here are the highlights of the process:
- backups were done successfully
- backups were sent to another server successfully
- restoring was mostly successful but had few errors concerning ssl and AWstats, (I’ll try to make the errors bold if I can):
virtualmin restore-domain --source /root/backups/virtualmin.tar.gz --all-virtualmin
Checking for missing features …
… all features in backup are supported
Checking for errors in backup …
… no errors found
Starting restore…
Extracting backup archive file …
… done
Restoring Virtualmin settings …
Restoring Virtualmin configuration …
… done
Restoring templates and plans …
… done
Restoring email templates …
… done
Restoring custom fields, links, categories and shells …
… done
Restoring custom script installers …
… done
Restoring scheduled backups and keys …
… done
Restoring DKIM settings …
… not installed
Restoring greylisting settings …
… not supported on source system
Restoring rate limiting settings …
… not configured on this system
Restoring mail server configuration …
… done
… done
Restore completed successfully.
virtualmin restore-domain --source /root/backups/ --all-domains --all-features
Checking for missing features …
… all features in backup are supported
Checking for errors in backup …
… no errors found
Starting restore…
Extracting backup archive files …
… done
Re-creating virtual server site1.pl …
Creating administration group site1…
… done
Creating administration user site1 …
… done
Creating aliases for administration user …
… done
Adding administration user to groups …
… done
Creating home directory …
… done
Creating mailbox for administration user …
… done
Adding new virtual website …
… done
Adding webserver user www-data to server’s group …
… done
Performing other Apache configuration …
… done
Setting up scheduled Webalizer reporting …
… done
Creating SSL certificate and private key …
… done
** Adding new SSL virtual website …
… certificate authority file is not valid : Data does not start with line -----BEGIN CERTIFICATE-----*
Setting up log file rotation ..
.. done
Creating MySQL login ..
.. done
Creating MySQL database site1 ..
.. done
Setting up AWstats reporting ..
.. done
Use of uninitialized value in string eq at /usr/share/webmin/virtualmin-awstats/virtual_feature.pl line 222.
Setting up password protection for AWstats ..
.. done
Creating Webmin user ..
.. done
Applying web server configuration ..
.. done
Re-loading Webmin ..
.. done
Saving server details ..
.. done
Restoring backup for virtual server site1.pl …
Restoring virtual server password, quota and other details …
… done
Updating administration password and quotas …
… done
Restoring Cron jobs …
… done
Extracting TAR file of home directory …
… done
Setting ownership of home directory …
… done
Restoring Apache virtual host configuration …
… done
Checking restored PHP execution mode …
… mode FCGId OK for this system
Updating home directory in PHP configuration …
… done
Restoring Apache log files …
… done
Restoring Webalizer configuration files and Cron job …
… done
Restoring Logrotate configuration …
… done
Restoring allowed MySQL hosts …
… done
Re-loading MySQL database site1 …
… done
Restoring Webmin ACL files …
… done
Restoring AWstats configuration file …
… done
Updating Webmin user …
… done
Re-creating virtual server site2.pl …
Creating administration group site2 …
… done
Creating administration user site2 …
… done
Creating aliases for administration user …
… done
Adding administration user to groups …
… done
Creating home directory …
… done
Creating mailbox for administration user …
… done
Adding new virtual website …
… done
Adding webserver user www-data to server’s group …
… done
Performing other Apache configuration …
… done
Setting up scheduled Webalizer reporting …
… done
Setting up log file rotation …
… done
Creating MySQL login …
… done
Creating MySQL database site2 …
… done
Setting up AWstats reporting …
… done
Use of uninitialized value in string eq at /usr/share/webmin/virtualmin-awstats/virtual_feature.pl line 222.
Setting up password protection for AWstats ..
.. done
Creating Webmin user ..
.. done
Applying web server configuration ..
.. done
Re-loading Webmin ..
.. done
Saving server details ..
.. done
Restoring backup for virtual server site2.pl …
Restoring virtual server password, quota and other details …
… done
Updating administration password and quotas …
… done
Restoring Cron jobs …
… done
Extracting TAR file of home directory …
… done
Setting ownership of home directory …
… done
Restoring Apache virtual host configuration …
… done
Checking restored PHP execution mode …
… mode FCGId OK for this system
Updating home directory in PHP configuration …
… done
Restoring Apache log files …
… done
Restoring Webalizer configuration files and Cron job …
… done
Restoring Logrotate configuration …
… done
Restoring allowed MySQL hosts …
… done
Re-loading MySQL database site2 …
… done
Restoring Webmin ACL files …
… done
Restoring AWstats configuration file …
… done
Updating Webmin user …
… done
Re-creating virtual server test.site1.pl …
Creating home directory …
… done
Adding new virtual website …
… done
**Performing other Apache configuration ..
.. configuration failed : Failed to copy /etc/php/7.0/cgi/php.ini to /home/site1/domains/test.site1.pl/etc/php7.0/php.ini : cp: cannot create regular file '/home/site1/domains/test.site1.pl/etc/php7.0/php.ini': No such file or directory**
**Creating SSL certificate and private key ..
.. SSL website failed! : Failed to open /home/site1/domains/test.site1.pl/ssl.cert.webmintmp.1393 : No such file or directory at ../web-lib-funcs.pl line 1433, <readout77> line 1.**
Setting up log file rotation ..
.. done
Applying web server configuration ..
.. done
Re-loading Webmin ..
.. done
Saving server details ..
.. done
Updating Webmin user ..
.. done
Re-loading Webmin ..
.. done
Restoring backup for virtual server test.site1.pl …
Restoring virtual server password, quota and other details …
… done
Extracting TAR file of home directory …
… done
Setting ownership of home directory …
… done
Restoring Apache virtual host configuration …
… done
Checking restored PHP execution mode …
… mode FCGId OK for this system
Updating home directory in PHP configuration …
… done
Restoring Apache log files …
… done
Restoring Logrotate configuration …
… done
Updating Webmin user …
… done
Enabling PHP modules for restored scripts …
… the following PHP modules were installed : mcrypt gd curl
Applying web server configuration …
… done
Re-loading Webmin …
… done
Restore completed successfully.