WordPress is pretty easy to use most of the time, but if you ever have to move a WordPress site to a new location or domain, get ready for some pain. It’s NOT easy and it’s NOT intuitive.
WordPress, for reasons I cannot explain, writes a full URL for all links and images in the database. For example, if you link to another WordPress post, the link gets written in the database as follows: http://mysite.com/blog/my-post. Furthermore, WordPress writes all image links as a full URL too; eg, http://mysite.com/blog/wp-content/uploads/2012/01/my-photo.jpg.
The problem with this method is that if you move the location of your WordPress site to another folder, or if you change domain names, all your links to posts and images will still point to the old location or domain name. Essentially, your site will be broken. (The domain name and site path should be stored in the wp-config file, not in each file or post link, but that’s another story.)
If you are moving your WordPress site to another location or domain name:
- Make a complete backup of all WordPress website files and the WordPress database. If you don’t know how to do this, then hire a professional to do it for you. No kidding: you could destroy your site beyond recovery.
- Go to the following URL first and read the section titled When Your Domain Name or URLs Change:
http://codex.wordpress.org/Moving_WordPress