Export Digitial Ocean droplet to XCP-NG

I have a digital ocean droplet and would like to have a copy of that server on my lab XCP-NG server. I have read that DO does not support exporting, but dd could be used. To that end, I found (and completed) the following command.

ssh root@my.do.ip.addr "dd if=/dev/vda1 | gzip -1 -" | dd of=do_backup.gz

That being completed, I realize that it’s a gz file and would need to be expanded, but… I am having trouble with figuring out what the next step is. I’ve tried doing some conversions to create VDI/VHD/VMDK files, but XCP-NG reports that no boot device is found. Now, I think that makes sense as the command run does not back up the drive as an entirety, but just one partition.

So, what am I here for? HELP! How should I go about mounting that partition or otherwise completing an import into XCP-NG?

So one thing to keep in mind with Linode and Digital Ocean droplets is that they are not VMs but are LXC or openvz (or some other type of container), so a straight DD will not work because some of these containers do not even have a kernel but instead share a kernel with the host system.

However, what you can try to do is install a fresh install of whatever distro you are using on XCP-NG and try the following:

  1. Make sure both systems are up to date
  2. Launch into a live boot environment on XCP-NG for the VM
  3. mount the disk to something like /mnt/whatever
  4. Chroot into the mount
  5. Do an rsync over ssh, copying the digitalocean droplet over ssh to your vm (excluding all boot properties and anything machine related). Some parameters I found on archwiki is “–exclude={”/dev/","/proc/","/sys/","/tmp/","/run/","/mnt/","/media/*","/lost+found"}"
  6. After the sync is complete, try booting the VM and see what happens.