Migrate your VM’s from AWS to Azure using xmigrate

Vishnu ks
xmigrate
Published in
4 min readJan 11, 2021

Migrating a server from AWS to Azure is not difficult or costly anymore. Let me tell you how.

Let’s start by setting up xmigrate in our laptop

Pre-requisites

  • You should create a free account in https://cloud.mongodb.com/
  • Next step is to create a database named migration with user and password from Mongo atlas console
  • You should have installed docker in your laptop
  • There should be connectivity between the server you want to migrate and your laptop
  • One user should be created/available with sudo privileges in the server which needs to be migrated
  • Currently, xmigrate only supports servers with OS Ubuntu 18.04 to moved to azure

Setting up

  1. Let's start the xmigrate application by running below command, make sure to replace the database URL with your connection URL
docker run -p 8080:80 --name xmigrate -e MONGO_DB="mongodb+srv://username:password@xmigrate.ao93h.mongodb.net/migration?retryWrites=true&w=majority" xmigrate

2. Open the browser and go to http://localhost:8080

3. Click on signup and create an account by entering username and password

4. Now you will be redirected to the login page. Use the credentials of username and password created in the previous step to login

5. Next step is to create a project. Give a project name and select the cloud provider which you want to migrate your infrastructure, in our case it’s azure.

6. After clicking on the Azure cloud logo, you have to enter the service principal credentials for your cloud account

7. If the credentials are correct, xmigrate will ask to select the location(azure region) and a resource group name(which is not present in your azure account). Click on create project button after giving the details.

8. Enter the storage account, container name and access key and click on save. This is to copy and store your VM image temporarily.

9. Then select `azuretestmigration` which you just created from project navigation dropdown at the top left side of the portal and click on Discovery from the left sidebar menu

10. Now you will be in discovery dashboard. Enter the IP, username and password for the Linux server you want to migrate and click on submit button and wait till Go to Blueprint button enables

11. Now navigate to Blueprint dashboard by clicking on Go to Blueprint button

12. Here you can see some pieces of information regarding the server. Scroll down and create the network, here Azure Vnet by giving a name and valid CIDR and then clicking on Create Network button

13. Click on the row with the network details to create a subnet by providing a name, a valid CIDR within Vnet CIDR range and the type, either public or private and click on Create Subnet

14. Once you created the subnet, the server details will be automatically populated inside the subnet table. Now you have to choose a VM type from the dropdown and then save the blueprint by pressing the save button.

15. Finally, you can click on the build button to start the migration

Once you have completed the above steps wait until the status becomes 100.

When it becomes 100, login to your Azure account and look for the VM inside the resource group with name xmigrate. Copy the public IP address and try to ssh into it using the default username and password, xmigrate and Xmigrate@13.

Note: There will be a provision to add a custom username and password for VM’s in future release

Thanks for reading and happy migrate!!

--

--