I'm sure at this point, you're a combination of excited, anxious, and a bit nervous. You've just migrated a database, moved quite a few files from one server to another, and updated a WordPress configuration file! We've got one more step to go, and this is to test your website by using a hosts file modification.

Before we continue, let's summarize our scenario:

  1. We're changing hosting companies, HostXYZ to Web Hosting Hub, and in this move we need to migrate our WordPress Site my-wordpress-site.com
  2. We want to test our WordPress Site before pointing it from HostXYZ to Web Hosting Hub to ensure there are no problems for us or our site visitors.

That's it. We've done all of the hard work, and now we need to test the site. We can't just visit my-wordpress-site.com, as this will show the site on HostXYZ's servers and not the content we just migrated. We also can't use our Temporary URL as WordPress is domain specific, in our case meaning the site won't look right on the Temporary URL. There are several other ways to test your site, but we find that doing a hosts file modification is by far the most accurate.

How does a hosts file modification work?

When you type in my-wordpress-site.com into your browser, your computer needs to know which web server to contact to download the webpage. It finds this server's address by asking a nameserver. You can think of a nameserver as a phone book. If you need to know someone's phone number, you look in the phone book. Your computer does the same thing, but it uses a nameserver instead.

If my computer asks a nameserver for the address of my-wordpress-site.com, it will return the address for a server at HostXYZ, which will not allow me to properly test. A hosts file modification instead tells your computer to NOT looks at the namserver (ie. phonebook) but to instead use a specific address (your server's IP address here at Web Hosting Hub). In this way, you can visit my-wordpress-site.com and see what it will look like on Web Hosting Hub's servers compared to HostXYZ.

Keep in mind that this change is only affecting your computer. All of your regular website visitors will continue to see your webiste on HostXYZ's servers, so you can test and debug all you need without causing any interruption for your normal visitors.

How do I test using a hosts file modification?

For more help with modifying your hosts file, please see either of the following links:

Windows - How to Modify your Hosts file
Mac - How to Modify your Hosts file

After you have successfully tested WordPress on the Web Hosting Hub server, you can be confident that when you update your domain's nameservers towards the end of the transfer process there should be little to no issues with your website after the move.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Comments

2013-08-16 1:36 am
I followed the steps to migrating WordPress, twice. When I get to the end, the WordPress installation screen comes up.
Another thing is that the fifteen minutes to migrate WordPress files took a couple of hours. Was everything supposed to be copied?
Still trying to get this going.
Staff
17,314 Points
2013-08-16 3:11 am
Hello PastorWill,

Sorry to hear you're having some difficulty with getting WordPress migrated. If you're having problems with all of the steps in migrating your WordPress site, then there's probably a factor that's not part of the migration steps that you're having an issue with.

I took a look at your account, and it appears that your domain name servers is still not pointed to our hosting server. If I type your primary domain into a browser it's going to a different host.

WordPress is a URL-centric application in that it takes the URL used in the installation (in this case stored in your database) to generate the URL for the pages of the WordPress site. If you're not using the domain name, then the URL that you're trying to use is incorrect. If you want to use the temporary URL, you would have configure WordPress to use it. Check out this article for more information on this option: Setting Up Wordpress using the temp URL.

If you change the name servers for the primary domain, remember that the change is not instantaneous. There is a slight delay of up to 24 hours called DNS propagation. I hope this helps to answer your question. Please let us know if you still require assistance.

Regards,
Arnel C.

You can
n/a Points
2014-07-22 1:38 am

Very good method to test migration.

I have a question though - testing from the computer with the modified hosts file is OK, but what about requests spawned from the actual "new" server itself?  For example, I go to "mysite.com" from my computer, and all looks great.  However how would the server itself know to request itself and not the "old" server?  (for example, a piece of AJAX that is requested).

 

Cheers

Staff
17,314 Points
2014-07-22 2:22 am
Hello Tim,

Thanks for the question. In general, when a user is trying to see a website, the computer they are using is what is making requests from the server. Requests initiated from the server side would still need to be able to identify a destination. So, these connections are only established after a connection is made with a requesting computer. With a modified hosts file, the requesting computer is forced to the IP address that is defined within the hosts file. Any requests on the internet would go to the normal IP address assigned to the URL, and only the computer with the modified hosts file would go to the "new server".

I hope that helps to answer the question. Please let us know if you have any further comments or questions.

Regards,
Arnel C.
n/a Points
2014-12-23 3:03 pm

Hi! Please check this url:http://toursite.escapadetravel.biz/  

It goes to http://toursite.escapadetravel.biz:8888/

Kindly help.

Thanks!

Staff
16,266 Points
2014-12-23 6:34 pm
Hello Vit,

I did a check on your site as you recommended but it is not redirecting to :8888 for me. Did you fix the issue or did it simply go away? Are you still having the issue yourself?

Kindest Regards,
Scott M
n/a Points
2016-01-01 10:11 pm

I migrated everything following the instructions in the tutorials. My server is WebHostingHub, but I wanted to migrate my WordPress to a subdomain instead of the primary domain. On testing the subdomain, I got the request to install WP. I entered user/PW, then the site is blank with "Hello World" post and standard theme. I checked file manager and all files are there. MyphpAdmin database seems to have imported properly.

n/a Points
2016-01-02 7:51 pm

I tried migrating my WordPress site to a subdomain on WebHostingHub from my primary domain on WebHostingHub following this tutorial. When I tested, I got a message to install WordPress with fields to enter user and password. After entering those fields, I got a blank WordPress site with the "Hello World" post as if a new instance of WordPress had been installed and no theme installed. The database appears to have migrated and all files are there. I only have one instance of WordPress installed (the original one; none installed for the subdomain).

Staff
1,348 Points
2016-01-04 4:54 pm
Hello Pam,

This article provides information about testing a WordPress site migrated from a different host. From the description of your issue it seems as if you may have re-installed WordPress.

There are a few different ways to move WordPress. This link should help you find the best method for you: https://codex.wordpress.org/Moving_WordPress
n/a Points
2019-11-28 2:19 pm

Today I migrate my website service https://topassignmentreviews.com

If any have checklist for migration issue, please guide me.

Staff
107 Points
2019-11-29 11:19 pm
Hi,

For more information and guidance on migrating your website,check out the articles in this series. If you need assistance, reach out to our Support Department.

Kindest regards,
Stormy

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}