This is an old revision of the document!
The BlueOnyx General Migration Utility (GMU) has been created to allow easy migrations from non-BlueOnyx servers to BlueOnyx 5209R. For this purpose it uses a custom Perl script to gather as much needed info as it can from a non-BlueOnyx server and then builds an XML file and tarballs that contain all info that is needed to perform an import on BlueOnyx 5209R.
On BlueOnyx 5209R we do have a script that can perform the import. This guide explains the usage.
Please note: Currently the only supported platform for exports to BlueOnyx are Verio FreeBSD and Verio CentOS-4 servers that run the Verio GUI. Support for further platforms will be added later (think Plesk & cPanel).
Login as 'root' on the server on which you want to generate the export. Or login as user with “wheel” access and perform “su -” to gain 'root' access.
Make sure you have enough disk space for the export and note which partition has the most space. This usually ought to be /home/. You can check the available disk space with the command “df -h”.
Download the migration utility:
cd /home wget http://devel.blueonyx.it/pub/BlueOnyx/TAR/Verio-to-BlueOnyx-5209R-exporter.tar.gz tar zxvf Verio-to-BlueOnyx-5209R-exporter.tar.gz cd Verio-to-BlueOnyx-5209R-exporter/migrator
Inside that directory is the script 'verio-export-to-blueonyx.pl', which is the only script you will need to run during the export.
To run the script you prefix it with './' - Example:
export_box# ./verio-to-blueonyx-exporter.pl -h ##################################################################### # verio-to-blueonyx-exporter.pl: BlueOnyx Generic Migration Utility # ##################################################################### # # Verio (FreeBSD and CentOS) to BlueOnyx 5209R exporter. # This utility parses the Apache and Sendmail config (and # cpx.conf) to generate an XML file and Tarballs that allow # you to import all Vsites and Users on BlueOnyx 5209R. usage: verio-export-to-blueonyx.pl [OPTION] -c export configuration only -d export dir (assumes /home/Verio-to-BlueOnyx-5209R-exporter/migrator/data/) unless specified -s SCP target details (like 'root@host:/dir/') -h help, this help text export_box#
The command line parameter '-h' displays the above help text.
Switch | Value | Meaning |
---|---|---|
-c | <none> | If you do not want to export any TarBalls with Vsite and User data, then you can use the '-c' switch. This will only export the configuration and information about Vsites and Users. |
-d | <local directory> | This allows you to specify where the exported XML (and TarBalls) will be stored on the export server. If not specified, then the 'data' directory inside the directory where the script resides will be used. |
-s | <root@target.com:/dir/> | If the server on which you generate the export does not have enough diskspace to store all TarBalls, then you can use the '-s' switch and can specify the full username, hostname and directory on a remote server. During export every TarBall is then generated locally and right after creation this TarBall is sent via 'scp' command over SSH to the remote server where you want to import. After the transmission the locally stored TarBall is deleted to conserve space. Please note: For this to work you need to exchange SSH keys. The export server must be allowed to login (w/o password) via SSH key on the target server. |
-h | <none> | Display the help text and exit. |
The exporter itself is very verbose and will tell you at ever step and turn what it does.
If you want to save the output of the exporter to a textfile for later review (without missing anything that goes on during the export), then you would perform the export this way:
export_box# ./verio-to-blueonyx-exporter.pl 2>&1 | tee export.log
In that case a log of all status and error messages will be written to 'export.log'.
To do the actual export run one of the two commands:
=To store export locally:=
export_box# ./verio-to-blueonyx-exporter.pl 2>&1 | tee export.log
=To store export remotely:=
On the remote server add '/root/.ssh/id_rsa.pub' from the export server to '/root/.ssh/authorized_keys'. Then create the import directory there:
import_box# mkdir /home/import
Go back to the server where you want to perform the export. Start the exporter there:
export_box# ./verio-to-blueonyx-exporter.pl -s root@10.1.254.1:/home/import/ 2>&1 | tee export.log
This will take a while. The progress will be shown on the screen.
The importer is named 'blueonyx-gmu' and is available in the BlueOnyx 5209R YUM repository. To install it on a 5209R run the following command:
yum install blueonyx-gmu
This will install 'blueonyx-gmu' and all dependencies. After the install of GMU there is only one script that you need to run the install:
import_box# /usr/sausalito/sbin/blueonyx-import.pl -h ########################################################## # blueonyx-import.pl: BlueOnyx Generic Migration Utility # ########################################################## usage: blueonyx-import.pl [OPTION] -c import configuration only -d directory of that contains the exported files -i import all virtual sites with this IP address -n import only these sites ie -n "ftp.foo.com,www.bar.com" -r remove items ie "-r (vsites|users|resellers)" -a skip import of all Reseller accounts -e just examine and verify dump -q Fix Vsite and User quota to OK limits -h help, this help text import_box#
The command line parameter '-h' displays the above help text.
Switch | Value | Meaning |
---|---|---|
-c | <none> | If you do not want to import any Vsites and User Tarballs, then use this switch. That will only create the Reseller, Vsite and User accounts and will import their configuration. |
-d | <directory> | This allows you to specify the directory where the TarBalls and the XML from the export server are located on the import server. |
-i | <IP Address> | If you need to change the IP Address of Vsites during the import, then you can specifiy the new IP Address of Vsites on the command line via this parameter. If not specified, then Vsites will be imported onto the same IP Address that they had during the export. |
-n | <“domain1.com,domain2.net”> | If you want to import only one (or a few) Vsites (and all their Users), then you can use this option. |
-r | <vsites><users><resellers> | If an import failed for any reason, then you can use '-r vsites' to remove all Vsites (and Users). If you want to only remove all Users (not System-Administrators!), then you can use '-r users'. If you use '-r resellers', then all Reseller accounts (including their Vsites and Users!) will be removed. |
-a | <none> | If specified, no Reseller accounts will be created during import. |
-e | <none> | Does not perform an import. Instead it will check the integrity of the XML file and the TarBalls in the specified import directory. |
-q | <none> | Does not perform an import. If with this option, then any Vsite or User that is over quota (or at +90% disk usage) will receive enough additional disk space to end the over-quota situation. This option is used automatically at the end of an import. |
-h | <none> | Display the help text and exit. |
Perform the Import:
Assume you do have the TarBalls and the BlueOnyx-Migrate.xml in '/home/import/' and you want to perform an import of all those Vsites and Users. And you want to change the IP Addresses of all Vsites during the import to '10.1.254.50' In this case you would run the following command on your BlueOnyx 5209R:
import_box# /usr/sausalito/sbin/blueonyx-import.pl -d /home/import/ -i 10.1.254.50 2>&1 | tee /tmp/import.log
This will perform the following steps:
Preparational steps:
Reseller related steps:
Vsite related steps:
User related steps:
At the end of the import the following correctional steps will be performed automatically:
Cleanup related steps:
Diagnostics:
Both the export and import scripts are very complex and contain roughly one month of man-hours in coding (packed into an intense two weeks of programming). I did test the exporter and importer extensively. But something might always go wrong and things might not work as intended.
Although the exporter is the most complex piece of code: It just should work. If it aborts with an error message for any reason, then get in touch with me and report the error message. Most likely I will need access to the box to diagnose this.