Moving Your WordPress Website to a New Web Server
- January 12th, 2013
- By Odysseus
- Write comment
This site is for those who are curious about how things work so I’m going to begin with some background. If you’re just interested in getting the job done, skip down to the How-To section.
Background
A website is a set of files that exist on a computer that is configured to run a special kind of software called web server software. The two most popular web server software packages are Apache Software Foundation’s Apache HTTP Server and Microsoft’s Internet Information Services (IIS). Computers that run web server software are often referred to as web servers even though they usually run many other types of software as well. A web server works by listening for HTTP requests from web clients. There are many types of web clients, but the most common kind is the web browser (Chrome, Firefox, Internet Explorer, etc.) When you type in an address or click a link, your web browser sends an HTTP request for a specific file on a specific web server. When a web server receives such a request, it will deliver the content of the requested file to the requesting web browser. When the requesting web browser receives the content of the requested file, it will interpret it as best it can and display it to the user. There are many types of content and many ways in which such content can be parsed and interpreted, but this is the basic process in a nutshell.
All web servers have an Internet Protocal address (or IP address) which is like a mailing address for computers. IP addresses, however, are hard for humans to work with. Instead, we use domain names, which are simply aliases for IP addresses. For example, if you run the command ping www.google.com, you should see output similar to the following.
Reply from 74.125.225.241: bytes=32 time=30ms TTL=55
Reply from 74.125.225.241: bytes=32 time=32ms TTL=53
Reply from 74.125.225.241: bytes=32 time=30ms TTL=55
Reply from 74.125.225.241: bytes=32 time=31ms TTL=53
The ping command tells us that we are able to communicate with the computer at IP address 74.125.225.241 using the domain name (or alias) www.google.com. This may seem complicated, but it is very useful when you want to do something like move a website from one web server to another. In our case, we wanted to move Section9 from a web server owned by A2Hosting to a web server owned by Arvixe Web Hosting. We were able to do this with almost no downtime simply by installing a copy of Section9 on the new Arvixe web server and then when it was ready, we simply went to our domain name registrar (GoDaddy) and updated the configuration of our domain name (section9.choamco.com) to point to the IP address of our new web server.
How-To
So from start to finish, a WordPress website can be moved to a new web server by following these simple steps.
- Backup up the old WordPress database. This is where your posts, pages, comments, menus and settings are stored. A good tool to use for this is the Export operation in phpMyAdmin. Be sure to export using UTF-8 character encoding.
- Backup the old wp-content folder. You can find this folder in your WordPress root location. This is where your plugins, images and other media are stored.
- Install WordPress on the new web server.
- Restore the old WordPress database on your new server. A good tool for this is the phpMyAdmin import operation. Be sure to import using UTF-8 character encoding.
- Restore the old wp-content folder into the new WordPress root location.
- Using the administration tool of your domain name registrar service, update the name servers for your domain name. Each domain name requires at least two name servers. These values are used by web clients to find the actual IP address of the server associated with your domain name. When you created an account with your new web hosting service, you should have received two name server names and their IP addresses. They often look like ns1.yourhost.com and ns2.yourhost.com. Replace the current name server values with the ones given by your new web hosting service. Once you make this change, there will be a 2+ hour delay, depending on your domain name registrar service and then all traffic to your domain name will be directed to your newly moved website.
- Test your website. If the links are broken, you may need to go to Settings->Permalinks and Save Changes in order to regenerate your permalinks. If there is missing data or your posts have been truncated, you probably have a character encoding mismatch. Re-export the original WordPress database making sure to use UTF-8 character encoding. This ensures that special non-ansi characters (like Chinese characters) can be handled properly. Then delete the new database (the one with missing data) and re-import it again using the UTF-8 encoded export file. Be sure to import using UTF-8 character encoding. Also, be careful how you transfer the exported file from the old web server to the new web server. Some services and/or programs can change the character encoding without your knowing it. Your best bet is to zip it up on the old server, transfer it, then unzip it on the new server.
If you have other issues or wish to move a WordPress site in another way (say from one domain name to another), feel free to email us or post in the comments section below. Also check out the this website for additional information on moving a WordPress site.


