WordPress Tips: moving site to another server
With this article we continue to share our experience of implementation the websites with free popular engines like WordPress, Drupal, Joomla etc. After delivering hundreds of such projects to the clients we collected number of tips/solutions which we think may be useful for other developers or clients. If you are interested in solutions to some problems you faced with please feel free to contact us - we’ll try to cover them as well.
If you ever tried to develop the WordPress sites you most probably faced with the problem we are describing. When you develop a WordPress site there is 99,9% chance that after development you need to move it from one server to another and even not just once. At the first glance there are no issues for more or less experienced developer - you just copy files and database to the new server and update config file with correct settings. After that you open your home page and see it working - so everything looks ok, but when you start clicking through the site you may be redirected to your initial domain (your development version) or extra folders may appear in your links so that the links are incorrect.
Why is that happening? The answer is simple - during the installation WordPress saves base URL in its settings and in many places including posts/pages content it saves absolute URL’s in database. This means that after you moved the site you should update URL’s in many different places, which involves extra work for you every time you need to move site. Also this makes very difficult delivering the project files to the client in case the client wants to install the site manually.
In order to solve this problem we have developed a simple PHP script which perfoms all the required actions automatically, you just need to copy it to the WordPress folder, run and follow the onscreen instructions. Below is detailed step-by-step tutorial.
- Upload wp-host-update.php file to your WordPress root folder
- Point your browser to this script by pasting http://yourdomain.com/wp-folder/wp-host-update.php to the browser address bar, replacing “yourdomain.com” and “wp-folder” by your real values

- The script will try to determine and pre-fill the values for your server, in most cases you don’t need to change them. After you made sure they are correct click “Update” button. If everything went well you should see a screen like:

- You are done and may enjoy your WordPress site at another server.
Notes: If you use permalinks you should go to the WP admin panel and update permalinks structure after running the script.
Important: We recommend you to backup your database before running wp-host-update.php.
Download: To download our script file please click here.
You are free to use and modify our script for information but please don’t remove our copyright information.
For those technical people who are concerned about other data in your WordPress tables here is short information on what happens inside the script. We do the following actions:
- Replace the options “siteurl”, “admin_email”, “upload_path” in the “wp_options” table
- Update fields “guid”, “post_content ” in the “wp_posts” table
Moving a Wordpress Site to another server | Advanced Wordpress Tutorials January 16th, 2010 at 4:54 am
[...] http://justcoded.com/article/wordpress-tips-moving-site-to-another-server/. [...]