Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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 ?

share|improve this question

2 Answers 2

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:\Windows\System32\drivers\etc\hosts

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.

share|improve this answer
    
That sounds like what I need (+1). I'll give that a shot –  George Profenza Apr 10 '13 at 16:46

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

  1. Login to AWS Control Panel
  2. Click EC Virtual Servers in the Cloud
  3. Click Running Instances
  4. Click The Instance With Your Future Website is Hosted
  5. 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

Certain information has been removed from the screenshot for security purposes, (AMI ID, INSTANCE ID, INTERNAL IP).

share|improve this answer
    
sorry but my question isn't how I access the EC2 instance via http (I can do that as you pointed out through the Public DNS or through an associated Elastic IP). my question is: how can I test a populated wordpress site running exactly the same as it were on it's original site on a test site(location on EC2) before I make the dns propagation settings thingie :) –  George Profenza Apr 10 '13 at 22:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.