Shutdown Source Environment and Update DNS

Shutdown source environment

In a real-world application migration, once you have completed all of your testing and are ready to fully transition your machines to the target cloud, you should perform the shutdown and termination of the source servers and update the DNS records properly to reflect the new servers running in the cloud.

It is a best practice to perform a test migration cutover at least one week before you plan to cutover to your target machines. This time frame is intended to identify potential problems and solve them, before the actual cutover takes place.

1. From the Bastion host, connect to each server from the list bellow. The necessary tools to connect are already installed in the bastion host.

  • For Linux VMs, use Putty or SSH.
Server Name FQDN OS Username Password
wordpress-web wordpress-web.onpremsim.env Linux user check team dashboard
wordpress-db wordpress-db.onpremsim.env Linux user check team dashboard
ofbiz-web ofbiz-web.onpremsim.env Linux user check team dashboard
ofbiz-db ofbiz-db.onpremsim.env Linux user check team dashboard

If you are using your own AWS account instead of EventEngine, please use the password provided during the CloudFormation launch

2. Shutdown the source servers running in the on-premises environment as per the following instructions:

# Linux

sudo shutdown -h now

Update DNS

Now that the source servers are shutdown, it’s time to update the DNS records to reflect the new servers that have just been migrated. On this lab, we use an instance running a version of Unix bind/named as the DNS resolver.

The steps bellow are related to updating the server A records in the Bind/Named DNS server build specifically for this lab. There are multiple ways to configure DNS in AWS. On a real migration scenario, the following steps could vary according to your DNS server configuration.

1. Open AWS Console

2. Go to Services then EC2 then Running Instances

3. Add a filter onpremsim.env to list only the servers that names contain this string

list running

4. Click in one of the servers from the list

Server Name FQDN OS Username Password
wordpress-web wordpress-web.onpremsim.env Linux user check team dashboard
wordpress-db wordpress-db.onpremsim.env Linux user check team dashboard
ofbiz-web ofbiz-web.onpremsim.env Linux user check team dashboard
ofbiz-db ofbiz-db.onpremsim.env Linux user check team dashboard

If you are using your own AWS account instead of EventEngine, please use the password provided during the CloudFormation launch

5. Write down the new Private IP address for that server get new ip

6. From the Bastion host, use Putty to connect to the new IP address

7. Run the following command to update the DNS record:

# Linux

ADDR=`hostname -I`
HOST=`hostname`
sudo touch /tmp/nsupdate.txt
sudo chmod 666 /tmp/nsupdate.txt
echo "server dns.onpremsim.env" > /tmp/nsupdate.txt
echo "update delete $HOST A" >> /tmp/nsupdate.txt
echo "update add $HOST 86400 A $ADDR" >> /tmp/nsupdate.txt
echo "update delete $HOST PTR" >> /tmp/nsupdate.txt
echo "update add $HOST 86400 PTR $ADDR" >> /tmp/nsupdate.txt
echo "send" >> /tmp/nsupdate.txt
sudo nsupdate /tmp/nsupdate.txt

8. Repeat the DNS update process for all the 4 servers listed above. Connect to each one of the servers and run the command listed above

9. Test the applications that have just been migrated. They are running in AWS now. Open the following URL using Chrome.

All the commands listed on this guide should be executed from INSIDE the Bastion host.

Application URL
Wordpress http://wordpress-web.onpremsim.env/
OFBiz ERP https://ofbiz-web.onpremsim.env:8443/accounting

This is a simple test, just check if both application webpage shows up.

OFBiz application uses a self signed certificate. It is required to add the exception on Chrome to be able to explore the application.

2. You should be able to visualize these 2 web applications:

Wordpress

wordpress

OFBiz

ofbiz

This is the end of this module

Feel free to execute the next module. Database Migration Service (DMS) to migrate the existing databases to Amazon Aurora by using AWS DMS.