Mobile app version of vmapp.org
Login or Join
Alves908

: Wordpress migration and testing on Amazon EC2 I will need to migrate a wordpress site to Amazon EC2. I've never done this before and it's not my area of expertise, so I'm following this guide.

@Alves908

Posted in: #AmazonEc2 #Domains #Migration #Wordpress

I will need to migrate a wordpress site to Amazon EC2.
I've never done this before and it's not my area of expertise, so I'm following this guide.

I am getting close to making the actual move (EC2 instance is setup, LAMP are ready, wordpress has a database ready, etc.).

My question is:
after importing the wordpress SQL dump from the source site to EC2, copying files(plugins/themes/etc.) and replacing urls in the wp_options and wp_posts tables,
will I be able to test before going ahead with the DNS settings ?

Once I copied the files and database from siteA to siteB and modified the wp options and posts tables to use siteB's IP, can I safely test the site without messing anything in wordpress even though the DNS settings are done yet ?

Is there a way to somehow use a 'shortcut'/sym link like thing so when I test files from siteB they temporarily use siteB instead of returning 404s ?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves908

2 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

Simples!

There is no need to update the DNS just yet as you can use the internal DNS before you go live... This way you can test the new site before taking down the old.

Follow these easy steps


Login to AWS Control Panel
Click EC Virtual Servers in the Cloud
Click Running Instances
Click The Instance With Your Future Website is Hosted
At the bottom of the page there is a message 1 EC instance selected, under this is the information you require. Look for Public DNS: and you can access your server with this without updating any DNS. (I've enclosed a screenshot so you can see where I mean).


Amazon EC2 DNS www.bybe.net/downloads/amazon-ec2-dns.png
Certain information has been removed from the screenshot for security purposes, (AMI ID, INSTANCE ID, INTERNAL IP).

10% popularity Vote Up Vote Down


 

@Nickens628

You could use the hosts file on your local machine (were you are browsing from) to temporarily set an ip on the domain in question. On a windows machine this file is: C:WindowsSystem32driversetchosts

So make an entry like so in that file:

101.102.103.104 mywpdomain.com


Now when you go to mywpdomain.com from that machine it will resolve the DNS lookup directly from the hosts file. This is immediate and you don't have to wait for the usual DNS propagation, of course, because there isn't any.

This will work as long as the machine at 101.102.103.104 is listening for requests to mywpdomain.com. Assuming everything is set up correctly, you don't have to change anything on your EC2 instance. All the requests will go to 101.102.103.104 with the correct header info just as though the entry were on a public DNS. You may need to occasionally comment it out so you can compare old and new (use # to comment the line).

Often what I do, is to set up a subdomain like test.mywpdomain.com and use that so I can see both sites. This procedure will need a little more work so your EC2 is listening for requests to that subdomain. You could do this on a public DNS, since they won't conflict rather than using the hosts file, but then you'll have to wait for DNS propagation. Or you could just as well put this entry in your hosts file as well. Putting it on a public DNS makes it easy for clients to see a new site, for example, before it actually goes live.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme