Moving WordPress To A New URL
By Adrian Sutton
Every so often I want to play around with something new on my blog without trashing the public site. I have a local instance of WordPress that I do most of my playing around on but it generally doesn’t have the some database configuration as symphonious.net so I can’t be sure that things I develop there will work here.
It is however simple to completely clone a WordPress instance to a new URL – but I never remember precisely how, so this is a note to myself so that next time I’ll remember.
- Copy over the WordPress files to the new location.
- Use WordPress Database Backup to dump the database – or you could use mysqldump.
- Reload the database content into the test database and adjust the wp-config.php file if needed.
update wp_options set option_value='%TEST_SITE_URL%' where option_name like 'siteurl';
Step 4 is the bit I forget the details of – it lets you log in to your WordPress admin page instead of just being redirected back to the original blog. From there you can adjust the public URL in the options page and whatever other things you want to do.