how to migrate virtual machine from digitalocean vps

I  moved a virtual machine(debian linux wheezy)  from digitalocean vps to my own vmware virtual machine successfully.There are a several steps which you have to follow.

1.Create and configure a virtual machine in vmware, boot a live cd(for example Ubuntu 12.04).

2.Configure network, check the internet connection,create a partition with fdisk or other disk utility.

3.Make sure dump utility is installed on both sides and ssh-server is started and allowed on the source side.

4.mkfs.ext4 /dev/sda1;mount /dev/sda1 /mnt;cd /mnt;

5. ssh 1.1.1.1 "dump -0uan -f - /" | restore -r -f -

Here, 1.1.1.1 is your digital’s ocean  virtual machine ip address.

It will take a time, depends on internet connection speed.

6.Use blkid  to view disks uuid , change your disk UUID in /mnt/etc/fstab

/dev/sda1: UUID="9068c98b-e8fa-4730-b746-0b719c772f57" TYPE="ext4"

7.Change the ip address in /mnt/etc/network/interfaces

8. mount -o bind /dev /mnt/dev
mount -t proc /proc /mnt/proc
mount -o bind /sys /mnt/sys
chroot /mnt
apt-get update
apt-get install grub-pc grub2
update-grub
grub-install /dev/sda

exit
shutdown -h now

9.Right click on the virtual machine and select Upgrade Virtual hardware.

UpgradeVirtualHardware

 

 

 

 

 

 

 

10.Power on virtual machine.

Leave a Reply

Your email address will not be published. Required fields are marked *