I’m currently developing a site we have installed on a sub-domain.
‘beta.mysite.com’
We will eventually, be moving site to it’s root domain.
‘www.mysite.com’
Problem?
any post type attachment / the files uploaded directly from post and page content editor, will the paths to staging environment ..
before ‘http://beta.mysite.com/wp-uploads/2010/07/image1.jpg’
after ‘http://www.mysite.com/wp-uploads/2010/07/image1.jpg’
How can I make a batch change to alter the prefix of any reference to staging site?
(e.g. replace the http://beta with http://www)
Or, how can I prevent this for my next project?
Check out this search and replace plugin. The benefit of using an absolute URL is that you can easily find and replace it, either with the plugin linked above or an SQL statement or even using some built in WordPress API’s. So I wouldn’t do anything differently the next time.
I used the search and replace plugin when I moved domains. Worked great. I would just avoid using it on anything other than the post_content field of the wp_posts table. Using it for
wp_options
orwp_postmeta
could get you into trouble because the whole serialized data thing.