Relocating a Wordpress Installation
Friday, December 12. 2008
Useful to know!
I’ve used export/import XML before, when moving between hosting providers.
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.
All I can say LornaJane, is that you are *ing brilliant!
I’ve moved older versions of Wordpress, and it is remarkably easy. But I can’t quite remember how I did it. And I didn’t think to post the solution on my blog…
I’m working on a project at the moment with the same problem.
I think the easiest solution is just to omit the wp_config table when exporting your SQL locally.
Or just copy the SQL into an update file in your repository. Then you can just run the file and execute the query.
Simon: good tip!
Michael: Ah, you can set it in the config … that could be a much easier way of doing it, thanks :)
cereal_girl: I actually use this blog instead of a brain, things go here that I know will leak out through my ears and be lost forever if I don’t record them!
Gavin: The separate SQL could work – although now I know I can put this setting in a config, I might change it to use server-specific config in future. So many possibilities …
I’d used the Quick Fix method at http://codex.wordpress.org/Changing_The_Site_URL but the config option looks much more sensible. Especially for dev->staging->live setups where you may need to do this a lot.
Strange they don’t cover that in the docs.
resists urge to say something rude about WordPress


