APPLICATION MIGRATION
Tags: cloud, devops, aws
Published: 2022-05-10 14:15:05

**WHAT IS APPLICATION MIGRATION?**
It is the process of moving data, applications, or other business components from an organization’s on-premises infrastructure to the cloud, or moving them from one cloud service to another cloud platform.

**So how can we migrate our data or applications server from one AWS account of a particular region to another AWS account of same or some other region?**

So this is the server (in place of on-premise I have used another AWS account)(application migration) in Mumbai region of one AWS account and we want to migrate it to the N.Virginia region of some other AWS account.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uhxmx9mt10b2m4xdn1fl.png)

Connect the server through xshell and install apache.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hltf886i5rwgf2x9bnks.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/73z4eq7pvgliki1d0eem.png)
 
 
Now we are required to host a website from our server which we want to migrate.

The below is the sample website (downloaded from free-css.com and sent to the server via WinScp) which we have hosted and connected it through the public IP of the server.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvex5szoontz7m4xomai.png)

Now go the the AWS account where you want to migrate your data.
1st type application migration in the search bar and then select **AWS application migration service**.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m735r91fje2jtbsma6xw.png)

Then click on add servers.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41wi7sqsphjb3be2fehy.png)

Then select your desired operating system. Here, we have chosen Linux.
Then select your replication preferences.
then create an IAM user and provide its access key and secret key.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqhnca3h2ew7yuh9m3y3.png)  

Then copy the commands present in point 4 and 5 and then paste in Xshell (one by one) where your server is connected.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19yje2fc73rwxj2rg1pd.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68hye9b7fp58dqbvfmwd.png)
Then go back to the source server and the click on source server's name.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rm1tgduq8a4z9iildifv.png)
As we scroll down we can see the replication initiation steps.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07b3iixmgqntk7jjyjxx.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z0vzz5kb8haxszaebcov.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bkjnhx4rnb6f26fpj156.png)
 
Then go to launch settings and click modify (in EC2 launch template).
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1au77eflll1tv0ovhqwl.png)
Give a template name.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1w8pvvtgfaqpbxvsayvh.png)
Then give the instance type of your choice and select your security group (by doing necessary changes) .   
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2tqvm7o6nhw0w9cm09n5.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/712xvkde7nt83mxcfa9l.png)

Then configure storage to gp2.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cynap9zqe88877vnwdxl.png)
Then add a new tag.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g5iyc8fibjpyk1d2wgnr.png)
Then in advanced details click on the checkbox of enable IPv4.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odzatbmnzlqv7xvf5jq9.png)
Then go to launch templates and then select and set it as default version.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2vf7v81gnsiiy3a14sb.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fco7adp6a63fpz0lnxjt.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8eguoyzyhiwqkgnblsh.png)

After the replication process will get over then an instance will launched in your desired AWS account where you wanted to migrate.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4cm6kg4zcs4hwil7pv4x.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tydzpxdp3ph65bjj34fy.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/24qycx71hmmfymf5ay9w.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgmsdhzhyar108dywvz2.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prdktqq3wsg1f0nxw78f.png)
    
Then again select the source server and then click on launch test instance.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oc9n51mh8kd1nn8yisgp.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8y9corrwh0bm3qv468k.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dgjnjlz08magq33kbczy.png)
Then another instance will get launched and after it gets stopped then the real replication server will be launched which we have attach an elastic IP and then after opening its public IP in the browser we can get to see the that the website which we have deployed in the server of the AWS account from where we have migrated the data, is up and running here.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6rttaox7t1nj2fg8ky1.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u8fz0z0xxmkpdiqs96bu.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n6eriymjtj9zhqdne6lk.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nep4xogow4lzfssgad0k.png)

Then again select source server and then click on mark as ready for cutover.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zyqrmgvyvbmbl7vhla21.png)
Then launch cutover instance.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vss2pz3b1m0atyh7bfj.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iogjtahotllfma7hvoe7.png)
In the job log we can see the details of work done in the backend.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qetljw9inbo1f4k4kc46.png)
Then finalize cutover.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2n2l0ppvv017dd5arol7.png)
 ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nfivr5d9bilhczegbgca.png)
then mark as archived.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/to6rp5vj9t3ault11gzo.png)
Then after that we can select the server's IP (attach an elastic IP) and can see the website is up and running.
  ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7r4yqarbszv2kq7r6h0.png)
 ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0f3yikj3lhfd078uhf8s.png)
This is the process by which we can migrate data from server of one AWS account to the server of another AWS account.