Relocating a Wordpress Installation
Friday, December 12. 2008
Wordpress is a fine basic website tool, and I've used it for a few different odds and ends. One thing it does have that suprises me every time is that it uses a setting for its web address. So as part of the install, it sets this setting and then everything works. Or rather it does, so long as the web address of the application doesn't change.
Well I'm working on something that I'm developnig locally, checking in to a subversion repository, and then deploying to another server (and other people will be doing the same when they collaborate with me). Wordpress isn't really designed for that, or for the situation where you have a copy of the database, and the code and need to restore it to a different place for any reason. The admin login form is accessible - but then submits to the old location before you can get in to change the settings.
Anyway it turns out to be really straight forward. The URL is in the database and a one-line query mends the problem. I'm putting it here for the next time I need it :)
UPDATE wp_options SET option_value = 'http://new.path.to/blog" where option_name = 'siteurl';
I found some complicated instructions for moving a blog too - but this will also work for that scenario. This was wordpress 2.7 (their new and shiny version!), I'm not certain which other versions this would apply to but add a comment if you can expand on this please!
Well I'm working on something that I'm developnig locally, checking in to a subversion repository, and then deploying to another server (and other people will be doing the same when they collaborate with me). Wordpress isn't really designed for that, or for the situation where you have a copy of the database, and the code and need to restore it to a different place for any reason. The admin login form is accessible - but then submits to the old location before you can get in to change the settings.
Anyway it turns out to be really straight forward. The URL is in the database and a one-line query mends the problem. I'm putting it here for the next time I need it :)
UPDATE wp_options SET option_value = 'http://new.path.to/blog" where option_name = 'siteurl';
I found some complicated instructions for moving a blog too - but this will also work for that scenario. This was wordpress 2.7 (their new and shiny version!), I'm not certain which other versions this would apply to but add a comment if you can expand on this please!
(Page 1 of 1, totaling 1 entries)



Comments