Migration of a Workload running in a Corporate Data Center to AWS using the Amazon EC2 and RDS service

Anurag Chawla
4 min readMay 3, 2023

--

Here mission to migrate a workload running in a Corporate DataCenter to AWS - The application and database were migrated to AWS using the Lift & Shift (rehost) model, moving both application and database data.

Cloud Project — AWS Provider with Services and Technologies

Solution Architecture: On- Premises Migration to AWS

Solution Architecture

First, create a new virtual private cloud (VPC) and inside will create two subnets

  1. public subnet — where provision the EC2 instance that will host our application that will migrate from on-premises Application Server

2. two private subnet (above only shows one in Availiability Zone 1) — where provision the Master RDS data in this RDS will be migrated from on-premises DB server and as per best practise there will be stand by another RDS in another AZ2 in case of failure.

Follow by creating Intenet Gateway — that is associated with VPC & create a route table — inside it route will point to internet gateway & update the route table so that outside users able to communicate to EC2 instance & able to send request to the application.

Now As per any project, follow the below migration steps:

Planning (sizing, prerequisites, resource naming)-where one should define the sizing of resources on-premises and mapped to migration on cloud.

On Premises — sizing of Servers with memory, virtual cpuand storage
On Cloud- Resources names, services provisioned in which region and availability zone, VPC and subnets etc.

Execution (resource provisioning, best practices) — where provides provisiong to resources like EC2, RDS. First, will start with creation of Virtual Private Cloud vpc-production-1

Your VPCc- Creation of Virtual Private Cloud

After that will create one — public and two-private subnets.

Subnets- one public- EC2 and two private -RDS

Now will create a Internet gateway followed by attaching to VPC

Internet Gateways -Creation of igw-mod3
Internet gateways-Attaching VPC to Internet gateway
Internet Gatway Successfully attached to VPC

Now after this, we need to update the route table for virtual private cloud that you have attached in the last step.

Route tables — Select the VPC and click Edit Routes
Edit routes- Select the Intenet Gateway and save the changes

Where 10.0.0.0/16 ->Target the local — its point to internal traffic- that helps to download the necessary packages inside the EC2 instance before deploying the application.

The other one 0.0.0.0/0 ->Targets the Internet Gateway — so that users from outside able to access the EC2 instance and also the packages it can install for running the application.

Once this is all complete- Next steps to provision the EC2 instance and RDS.

EC2 -Instance created : awsuse1app01

EC2 Instance — awsuse1app01 created

RDS Instance created -awsuse1db01

Once these EC2 & RDS instances created- follow the below pre-requisites to install on the EC2 instance so that able to run the commands to migrate the the web-app and data-dump of mysql from on-premises to AWS Cloud using S3 bucket.

On Cloud — prerequisites that needs to install on EC2 & RDMS before deplying application and dump files

After this - its easy to import files to EC2 instance for web-app and for data-dump for RDS -Connect to remote msql from EC2 instance running ubuntu.

Remote Connect from EC2 — connect to mysql
  1. create database wikidb
  2. use database — wikidb and dump the source dump-en.sql that will create 4 rows.
Dump data that contains 4 rows.
Tables — that shows articles and users.

Now connect web- application to mysql.db doing the necessary configuration changes related to database endpoint and proceed with executing on CLI -python3 wiki.py to validate the connection

igratUnzip the wikizapp-en.zip that moved from on-premise to EC2 instance

Before Go-live (validation test — Dry-run, final migration — Cutover)

After migration of web app & database mysql- do business validation test open the browser — with EC2 instance having public-ip on port 8080- you can able to see your web-application- havign Dashboard as under.

Migrated to AWS- running web app on EC2 and connecting to mysql from RDS service.

--

--

Anurag Chawla

Emerging Technologies - Power Virtual Agents | AI Chatbots | Multi-Cloud & DevOps | UI Technologies - React , Angular | Gaming Technolgies - Unity, XR- AR/VR