There’s some information on this sort of thing on the WordPress Codex at:

http://codex.wordpress.org/Changing_The_Site_URL

WordPress is generally very crap about moving a blog from one location to another, whether it be from a development site to a production site or from URL to another. The instruction for moving your site from one hostname to another are unbelievably complicated and come with scary warnings:

http://codex.wordpress.org/Changing_The_Site_URL#Domain_Name_Change

You can also define(‘WP_SITEURL’, ‘http://…’) in wp-config.php to set the site url dynamically. (This also marks it uneditable in the admin interface.