EC2 Instance Migration to a different Region. How and why ?

Search for a command to run...

What is the problem with your server, can you help me
AWS Agent Plugins let AI coding agents deploy, architect, and operate on AWS. Here's what that means for the future of DevOps.

AWS Storage Gateway bridges your on-premises infrastructure with Amazon's cloud storage — letting you use familiar protocols like NFS, SMB, and iSCSI while your data lives safely in S3, EBS, or Glacie

This AZ-104 domain emphasizes secure identity management and efficient resource governance, which are essential for Azure administrators to ensure compliance and cost control. Overview of Azure Identi

Scaling your EC2 instances to match dynamic workloads can be challenging. Amazon EC2 Auto Scaling simplifies this with target tracking scaling policies, a powerful feature that automatically adjusts capacity to maintain optimal performance and cost e...

IntroductionAmazon Elastic Block Store (EBS) is a cornerstone of AWS storage solutions, offering persistent block-level storage for EC2 instances. While EBS volumes are typically attached to a single instance.# EBS Multi-Attach breaks this mold, allo...

CloudCubes by Jinesh
45 posts
Cloud Infrastructure Consultant
Find me here : jineshkumar.bio.link
https://jineshkumar.com
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
Prerequisites:
AWS Account (Free Tier is Welcomed)
Putty
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 ?
example: ec2-xx-xxx-x-xxx.compute-1.amazonaws.com
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 : http://ec2-xx-xx-xx-xx.eu-west-2.compute.amazonaws.com/
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.
Happy Learning.
Like and Follow for more Azure and AWS Content.
Regards,
Jineshkumar Patel