AWS Cloud spans around 84 Availability Zones within 26 geographic regions around the world. With this Global Presence on a massive scale, AWS Customers use them to build their IT Infrastructure highly available and more robust.
In this Blog, We will see how we can migrate/copy AWS EC2 Server from one AWS Region to a different AWS Region Step by step.
Objective: Migrate EC2 from one AWS region to another AWS region
AWS Account (Free Tier is Welcomed)
Why ? :
Let's say Company XYZ has started using AWS for one of their clients, and the primary condition is having a copy of the complete project setup available in multiple regions for a Disaster recovery Scenario.
How ? :
Follow the instructions given below to work on How to do it.
Follow Along :
Create an Amazon EC2 Instance name "WebServer-Virginia" in Virginia region (us-east-1).
(Select Amazon Linux 2 AMI and t2.micro instance type and all default settings in the Launch Instance Wizard).
Note : Port 22 and Port 80 and 443 needs to open for Inbound Traffic in Security Group Settings.
SSH into the EC2 Instance and Run below Commands to Install the Apache web server
How to SSH EC2 using Putty from Windows Step-By-Step
sudo yum update -y sudo yum install httpd -y sudo service httpd start chkconfig httpd on sudo systemctl enable httpd sudo usermod -a -G apache ec2-user
Boom !! Default Apache WebServer is ready. Wanna Test Default Test Page of Apache ?
Go to your EC2 Instance's Public IPv4 DNS copy URL and Open in a new Tab of a Browser.
Now back to the main requirement, Next steps to Migrate this Default Web Server to a different AWS Region.
Create a Snapshot of this VM EC2 Instance
Create an Image (AMI-Amazon Machine Image) from a Snapshot
Copy Image(AMI) to London Region (any other region in AWS)
So far, Original Web Server EC2 is in AWS's Virginia Region (Us-east-1) and now It's AMI-Amazon Machine Image is Copied to London Region (Eu-west-2)
Launch Instance in London Region from AMI
Launch Instance from AMI Note: Launch Instance Wizard shows AMI is selected from London Region "ami-022aa40367eac6824" and New Name of the Instance will be "WebServer-London". Create New Keypair and Launch. Also Make Sure London Region's EC2 Instance's Security Group allow SSH and HTTP/S Traffic in inbound rules.
The Launched Instance this time will be Launched in London Region (eu-West-2) Test your London Region Web Server for its Default Apache Test Page already setup by Going to London EC2 Instance's Public IPv4 DNS and copying the URL and Open in a new Tab of a Browser.
Example : ec2-xx-xx-xx-xx.eu-west-2.compute.amazonaws..
And this is how We successfully Migrated WebServer from Virginia Region to make WebServer in London Region.
Thank you for reading and following along with the Blog.
Like and Follow for more Azure and AWS Content.