This tool will help you transfer a vps from one dom0 server to another.
aa. Check you can SSH from the source Dom0 to the target Dom0 using Keys.
bb. Check you have rsync installed on both servers.
Get the script
wget https://gitlab.com/dtcsource/dtc-xen/raw/a7fbc91167f2ff56c2fd64de5823dcd3bad622b1/src/dtc-xen_migrate_v2(approve sites)
/usr/share/dtc-xen/dtc-xen_migrate_v2 vpsToMove destinationIP 2>&1 | tee Transfer.log
The use of "2>&1 | tee Transfer.log" means that you will see the debug output on your screen at the same time as it being written to a file which you can review.
In development we run into a number of issues that are not handled in the code at time of writing this page.
For our test we were transferring xen05 between our machines.
* DomU not running....
Error: Domain 'xen05' does not exist.
It's not running, the script assumes the source VPS is running.
In our testing we ran the script a number of times. We had to restart the source DomU each time we reran it.
Solution: Restart the source vps. (eg xm create xen05 or xl create xen05)
* How the program works...
It takes a snapshot copy twice, rsync it across... while the original one is still running, then it shuts down the original one, and takes a rsync of that shutdown one (the diff should be pretty small), and it means that the migration should be pretty quick between shutting down of the original, and starting up of the destination
* Can't find the file system...
BusyBox v1.22.1 (Debian 1:1.22.0-9+deb8u1) built-in shell (ash)
Enter 'help' for a list of built-in commands.
/bin/sh: can't access tty; job control turned off
If the VPS goes into initramfs, it means it can't find the root filesystem.
If it can't find the root filesystem, it probably means it can't see it at all, or it's pointing to the wrong place.
In our testing we proved that the problem was that the files just hadn't been transfered because our snapshot hadn't worked because of the syntax of our snap shot needed the VG name as well as the LV.
+ sudo lvcreate -L10G -s -n xen05.snap xen05
The origin name should include the volume group.
Run `lvcreate --help' for more information.
Snap creation is failing
lvcreate -L10G -s -n xen05.snap /dev/vg01/xen05
* Dealing with a read only file system
If something goes wrong with the file system transfer you might need to run fsck to check it.
fsck -f -y /dev/vg/xen05
In this example fsck is being run on the xen05 LV in our VG called vg.