How do I correctly transfer my site from one domain to another?

These two pages on the WordPress codex give a good overview changing URLs:

http://codex.wordpress.org/Changing_The_Site_URL

http://codex.wordpress.org/Moving_WordPress

However to cut a long story short, what I always do is the following:

  1. Back everything up
  2. Copy this handy little file to the root of your site: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
  3. Run it
  4. It should pick up all of your settings, so all you need to do is enter the old URL as the one to search for and the new as the one to replace it with.
  5. Once that’s done you’re ready to point the new URL at the site
  6. If you need to, obviously export the entire database to an SQL dump file and copy that and all the web files to the new location

I’ve never had any problems with this procedure.

A brief word on the searchandreplacedb2.php you downloaded in step 2. Lots of advice is to simply use a text editor to search and replace the old URL with the new URL in the SQL dump file. This will almost always work OK. However it can lead to problems. WordPress makes heavy use of serialised arrays. If you have a plugin that for some reason stores the site’s URL in a serialised array you risk breaking the plugin by doing a simple search and replace in a text editor. See the URL I linked to for further information on this.