Special thanks to Dale Ellis email@example.com for this guest post. I hope it saves you the grief he suffered:
I recently redesigned a site for a client with WordPress and hosted it on GoDaddy. Unlike a standard blog where we would be starting off from scratch, there was already an existing site, hosted on another service, with a lot of content so we used GoDaddy’s Preview DNS feature to give us time to put in the necessary content before switching over to the new site.
This feature allows you to preview your site on a separate URL with previewdns.com appended to the normal domain name.
Several days after launching the new site, many of the pages suddenly appeared with broken image link indicators. It turns out that the previewdns.com domain will get assigned to any images you upload in the WordPress database so, when the Preview DNS expires, WordPress will be looking for the images in a domain that no longer exists.
GoDaddy’s technical support, while usually very good, was not able to provide us with an easy solution to this problem. Their recommendation was to re-upload the images to the site under the new, real domain name – but at that point that would have amounted to uploading a few hundred images again and, through the WordPress system, would have cost us a lot of time and effort.
After doing some research it turns out that there are a couple of fairly quickways to correct this problem, but they require performing the equivalent of afind-and-replace command on the MySQL database that WordPress uses. These processes can be risky so you may want to backup your WordPress database before performing these procedures (http://codex.wordpress.org/WordPress_Backups)
The first method, which I consider the easiest and preferable way, is to download and install a WordPress plug-in called “Search and Replace,” which you can find at http://wordpress.org/extend/plugins/search-and-replace/. This should allow you to search for and replace all the instances of http://www.[yoursitedomain].com.previewdns.com with http://www.[yoursitedomain].com.
If the plug-in method doesn’t succeed in eliminating the extra “previewdns.com” from the URLs, the next method involves operating on the MySQL database at a lower level. The first thing you’ll want to do is make sure that WordPress is that the domain name is updated in the WordPress’ options. Two good sources for instructions on that are GoDaddy’s help system (http://help.godaddy.com/article/5712?).
The second thing you’ll need to do is replace all the instances of the
previewdns.com URL in the database with the new, normal URL for your site(replacing http://www.yoursitedomain.com.previewdns.com with http://www.yoursitedomain.com) Full, detailed instructions on how to do that can be found at Lorelle Van Fossen’s blog at http://lorelle.wordpress.com/2005/12/01/search-and-replace-in-wordpress-mysql-database/
That took care of the problem for me – saving hours of rework – and it should for you, too!
– Guest post by Dale Ellis firstname.lastname@example.org