Digital Ocean does not allow you to download backups or shanpshots of the droplet. This may be a problem if you want to migrate from Digital Ocean to somewhere else.
- Boot into Recovery Console (choose Boot from Recovery ISO option) for the source droplet. If you need specific backup or snapshot, you would need to restore it either into source droplet or create a new droplet out of it.
- Login to the Recovery Console. You would need to choose Interactive Shell mode. Figure out what drives you need to backup (using
lsblk
for example). Usually it is/dev/vda
. - Dump the drive to an image using SSH. It should accept your SSH keys allright. Launch this command:
ssh -o UserKnownHostsFile=/dev/null root@<droplet-external-ip> "dd if=<drive-to-backup> | gzip -1 -" | dd of=<image-name>.gz status=progress
# Example:
# ssh -o UserKnownHostsFile=/dev/null root@162.36.52.210 "dd if=/dev/vda | gzip -1 -" | dd of=image.gz status=progress
Note:
-o UserKnownHostsFile=/dev/null
is used to mitigate SSH keys strict check protection error. You can omit it if you've never connected to that host prior.
To restore the backup, you would need to decompress is using gzip, like so gzip -d image.gz
.
And then dd it onto your target drive, like so dd if=image of=/dev/sda
.
You will get the original partition setup, which might mismatch your target drive geometry, but it is OK as long as your target drive is bigger than image size.
But thats another story, look for partition resize solution.
For Vultr the procedure would be slightly different:
passwd
command. Then modify iptables rules:iptables -F INPUT && iptables -A INPUT -j ACCEPT
. Then check the drive path, same way as for Digital Ocean usinglsblk
.