NB: Try to make sure there are no /
's on the end
Wordpress doesn't use these on a few of the links, and sometimes this will stop the following commands overwriting what they need to.
To use this SQL, open up PHPMyAdmin or similar and then click on your database. One of the tabs at the top should be called SQL. If you click this, you will be shown a text input area where you can paste in this code.
So, I always get totally confused when I'm moving a wordpress site from production to live server. I know that I have to upload the mysql database... then I get confused with which SQL queries I have to do...
...but not any more! Just put in your testing server url in the first box, and the new server url in the second box, then copy and paste the SQL into your PHPmyAdmin for the site you're working on.
NB: I take no responsibility for this going wrong! Please make sure you have some idea of what you are doing and keep backups of your databases!
Massive kudos to this guy (and everyone else who I've seen use pretty much the identical code!): http://www.coolestguyplanettech.com/updating-wordpress-mysql-database-after-moving-to-a-new-url/
JavaScript by djave