How to Celebrate International Women’s Day? A Girl in Tech Self-Migrated Bluehost Websites to AWS Beautifully.
~~~~~you are accessing an AWS hosted website~~~~~
To celebrate International Women’s Day, I decided to migrate my websites to a popular place, AWS, from my current host, Bluehost.
With AWS, my websites can enjoy,
Better Reliability
More User-Friendly
Greater Support
More Features.
This article Amazon Web Services (AWS) vs. BlueHost is a detailed comparison between these two services. Another article Amazon Web Services (AWS) Hosting vs BlueHost gives informative information about them.
If you are migrating business websites or transforming the enterprise business to the cloud, I suggest you following the recommended methodologies by AWS (e.g., the process below). You can find them easily on AWS White Paper, a great place for AWS knowledge.
There are 7 overall steps in this migration. Within each step, there will be sub-steps to guide you. You don’t have to know coding, programming, and computer network in order to perform this migration.
Step 1 Register an AWS Free Account
Step 2 Create an EC2 in AWS
Step 3 Create a Zone in AWS
Step 4 Change DNS in Bluehost
Step 5 Create Redirect in AWS
Step 6 Copy from the Old Site to the New Site
Step 7 Remove Bitnami Banner
~~~~~you are reading from an AWS hosted website~~~~~
Step 1 Register an AWS Free Account
Go to AWS website https://aws.amazon.com/ and click on Sign In.
On the Sign-In page, you can create a new account.
You need to provide credit card information in the registration process. And AWS will test the credit card validity.
If the card info is wrong, you will not be able to use any services.
The validating process might take some time depending on the information provided and card type. But overall, this is a simple process.
You just need to follow the instructions on AWS.
Remember to check your email because AWS will send you emails to inform you any issues in the registration process.
You can refer this site, https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/ for detailed instructions.
Step 2 Create an EC2 in AWS
Refer to this site, https://aws.amazon.com/getting-started/tutorials/launch-a-wordpress-website/ and you will be able to do it smoothly.
Note down the public IP address, which is the one you use to access the newly created website.
~~~~~from the Step 3 onwards, there will be no AWS offical guide~~~~~
Step 3 Create a Zone in AWS
↓ 3.1 Go to Route 53.
↓ 3.2 Click the creation button.
↓ 3.3 Enter domain name. Pay attention here. The domain name must be the exact domain name of your website. ‘www.domain.com’ is different from ‘domain.com’. Bluehost can auto direct between’domain.com’ and ‘www.domain.com’. AWS will not. But there is a solution, which will be covered in the step 5.
↓ 3.4 Two records will be auto-created. Pay attention to the 4 highlighted lines. You will need them later.
↓ 3.5 You need to create a new record.
↓ 3.6 Leave the Name field blank, Type as A – IPv4 address and Value as the public address you obtained in Step 2.
Step 4 Change DNS in Bluehost
↓ 4.1 Let’s use this site to validate whether our site migration is useful. I don’t suggest using CMD to ping the URL. I was using that. It seems AWS have a defensive mechanism. Even though my site was migrated successfully, CMD still returned me LOST.
↓ 4.2 From the result page, you can see the connection is good and the results come from 2 places.
↓ 4.3 Log in to your Bluehost.
↓ 4.4 Select the website your want to migrate, and change the Name Servers. Leave other info as it is. It might take a few minutes.
↓ 4.5 Repeat 4.1 and compare the result with 4.2. If they are different, it means you have changed the Name Servers SUCCESSFULLY. Now you enter your site URL, you will see the newly created site in AWS.
~~~~~we are finishing soon~~~~~
Step 5 Create Redirect in AWS
↓ 5.1 Go to S3.
↓ 5.2 Create a Bucket for redirecting ‘www.domain.com’ to ‘domain.com’, vice versa. This is to solve the issue mentioned in 3.3.
↓ 5.3 Enter the name of the domain you want to redirect. Note, it is not the domain you want to direct to.
↓ 5.4 Go to edit the property.
↓ 5.5 Choose Redirect and enter the domain you want to direct to.
Step 6 Copy Everything from the Original Site to the New Site
↓ 6.1 I used UpdraftPlus to back up my original site and restored the backup from the newly created site in AWS. There are plenty of ways to do it through FTP, Linux, etc. However, since some people already programmed the tool, why not using it? Save the manual work! Install UpdraftPlus in both the original site and the new site.
↓ 6.2 After installing UpdraftPlus, it appears at the top of the window. Go to setting.
↓ 6.3 We backup the site to AWS S3.
↓ 6.4 However, you need the address, access key and secret key. Let’s go to AWS to find them.
↓ 6.5 Login to S3. Go to the following directory.
↓ 6.6 Follow the instructions to create Security Credentials. You only have one chance to save the Security Credentials, i.e., the access key and secret key. Save it to somewhere important. If you lost it, you ahve create a new set.
↓ 6.7 After that, create a bucket, which you have already practiced in Step 5. Don’t need to configurate any property. Just remember the name of your bucket.
↓ 6.8 After put the bucket name, secrect key and security key into the setting. Then you go to Current Status tab. Click Backup Now. After backup, you can go to S3 to check whether you get any files in your bucket. There should be some files.
↓ 6.9 Go to the newly created site, restore from S3.
↓ 6.10 Scan the remote backup location to find the backup in S3.
↓ 6.11 Hit Restore.
↓ 6.12 Backup is successful.
↓ 6.13 I changed the Name Servers in Bluehost back to the original ones in order to test whether the restoration is successful by typing the IP address in the URL field. After this, you can change it back to the AWS name servers.
Step 7 Remove Bitnami Banner
↓ 7.1 Everything is perfect except for one thing. There is a banner on the lower right corner. And it might be dangerous.
↓ 7.2 Let’s remove it by editing the CSS file instead of through changing the backend via command lines.
↓ 7.3 Where to change? Depending on your site, the directry of Cusom CSS file might be different. As long as you can find it, add this line into it, ‘#bitnami-banner {display:none;}’.
↓ 7.3 Open a private window, test the change. Yes, it is gone. And you, have completed the site migration.
Finished!
~~~~~you are accessing an AWS hosted website~~~~~
Feel free to comments and share!