Migration of a Workload running in a Corporate Data Center to AWS using the Amazon EC2 and RDS service
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.
Solution Architecture: On- Premises Migration to AWS
First, create a new virtual private cloud (VPC) and inside will create two subnets —
- 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.
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
After that will create one — public and two-private subnets.
Now will create a Internet gateway followed by attaching to VPC
Now after this, we need to update the route table for virtual private cloud that you have attached in the last step.
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
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.
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.
- create database wikidb
- use database — wikidb and dump the source dump-en.sql that will create 4 rows.
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
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.