I find myself using this little snippet of code that is added to the wp-config.php file quite a lot these days with customers that are migrating from one host to another and need to use a testing URL. Simply adding the following lines of code to the wp-config.php will force WordPress into using that URL instead of the one specified within the database for things.
define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');