Move Your WordPress Blog from Development/Staging to Production

December 8th, 2008 | Posted in MySQL, Wordpress
1

When you are finished with development and staging reviews there are some database changes that need to be made in order for your WordPress blog to work properly.

You can use any MySQL tool you have available, my favorite is Navicat.

Options Table

The options table stores all of the main settings for your blog. You will need to update the URLs that were originally set during installation as well as where your uploads are stored.

Update URLs

UPDATE wp_options
SET option_value = 'http://www.yourwebsite.com'
WHERE option_name = 'siteurl'
	AND option_name = 'home'

Update Upload Path

UPDATE wp_options
SET option_value = 'wp-content/uploads'
WHERE option_name = 'upload_path'

Galleries

If you have galleries in your posts you will need to update the URLs for the images to your production URL.

Update Image URLs

NOTE: The ‘localhost’ value below should match what you entered during installation on your development/staging server.

UPDATE wp_posts
SET guid = REPLACE(guid, 'localhost', 'www.yourwebsite.com')
WHERE post_type = 'attachment'
	AND post_mime_type = 'image/jpeg'

Related posts

Comments (1)

  1. looking good… imo new mobile me by the way WordPress 3.0 is out Joomla 1.6 is in Beta3 Drupal 7 at Alpha5 (Beta coming soon) exciting times for php open source CMSs yuppiii

Leave a Reply