SImplest method is just to open your sql in a text editor, then do a find and replace on all instances of http://oldurl.com with http://newurl.com.
I do it all the time, and it nevers misses a beat.
Thread Starter
Jack
(@jacknet52)
This really looks daunting. There must be hundreds of incidences of code pertaining to my url including email addresses etc.Not all have to be changed and not all the same way. Does Apache require the “www.”? I mean do you guys actually run 2 copies of your website: one “on site” and one on the developmental computer. Don’t you have to change your database every time you make a mod to your development program and then upload to your site? Is there some document in here that speaks directly to running 2 copies of your site? One on site and one locally?
I run a local copy of any site using a seperate domain suffix.
So, say I’m developing a site for http://widgets.com I’ll set up my local install at http://widgets.loc.
Then when I migrate from dev to live sites, I do a find and replace on the widget.loc string, replacing with widget.com.
No, not generally, Apache does not require it.
Yes, if you are developing a local site, and you want to take any changes you have made locally to your live setup, you need to reflect your local changes to your database to your live sites database.
Thread Starter
Jack
(@jacknet52)
@noponies: Thank you for all your help and response. Ok I got the main index.php page to post on Apache2:localhost. But none of the catagory, or page links work. Can you tell me what else I need to fix. I’m assuming I have to go into the WordPress files in my www folder now and replace…?
How have you set up your local environment? Is it in MAMP, or something similar or are you just running the site from your machines web folder?
I use a mac and run my wordpess installs from my users/sites folder.
But it sounds like you have got a mod rewrite issue, or your sites permalinks are out. You dont need to change URLS in your wordpress php files. The find and replace occurs in your databases SQL file.
Thread Starter
Jack
(@jacknet52)
Hi again @noponies – I use LAMP with Ubuntu 11.10. Sorry I didn’t say that earlier. I open a browser and type “localhost/wordpress” and it goes to my www folder, which I modified in Apache to run from my Home folder. And the whole first page loads, just like on my live site but none of the links work ie: comments, posts, catagories etc.
What are your permalink settings? Are you able to get into the back end of your site?
Sometimes its simpler when setting up on a local host to set permalinks back to their default, as this removes any need for mod rewrite.