[Last Call] Learn how to a build a cloud-first strategyRegister Now


Setting Up WordPress Site from Server to Local

Posted on 2012-09-14
Medium Priority
Last Modified: 2012-09-18
I recently downloaded the WP files and imported the MySql DB for a WordPress site that is working OK online on a Windows shared hosting account.

I've successfully migrated the site to my Linux Mint 13 PC running WAMP. Everything works fine except my images are missing. I've updated the site URL fields in WP from the web URL to 'Localhost' but for some reason, it still can't see the correct image folder.

The WP version is 3.0.4 and I want to upgrade to 3.3.2 locally before trying applying changes the live site. I'm confidant that I will have problems with plug-ins and the template so would rather do the work offline but also need to be aware of the differences between local and online in doing this work.

Thanks for any suggestions in resolving my issue.
Question by:jaysch
  • 2
  • 2
  • 2
  • +1
LVL 70

Accepted Solution

Jason C. Levine earned 501 total points
ID: 38399695
It's not enough to change the URL in Settings when moving to a new domain name.  All of the images and possibly some links inserted in content may still have the old domain.

Try following the instructions here:


specifically Step 2: Changing URLs and Paths.  There are some SQL commands there that should resolve the issue.

Assisted Solution

g3nu1n3 earned 501 total points
ID: 38399817
The question would be do you only have some images that are not appearing. If so, more than likely they are hard-coded into the place where they are. What you can to do is use a browser based development tool like FireBug so that you can view the code and check what is going on under the hood.

WordPress will make the proper adjustments regarding your URLs as long as WordPress is in control of them. It is highly likely that if everything is working fine besides the fact that the images are not loading, that the paths for them are incorrect. Even with your home and site URLs being localhost, you will more than likely need to adjust the paths of your images in the database so they load properly.

Since you should have the .sql file (backup) of your database, it is only a text file really so you can use a text editor to find and replace the paths with the appropriate ones.

Author Comment

ID: 38400836
I have followed all the suggestions including doing the search and replace on the DB. All update queries ran OK. All paths in the local DB look correct yet the images are still not visible. I can find a particular image SRC, copy it and browse to it OK but not see it within the host page.

The folder and file permissions are set OK. I have other WP sites within the same local folder structure ( /var/www/website) and they work fine.

I'm thinking this could still be a Appache2 server issue but not sure what it could be.

Any other ideas would be appreciated.
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.


Expert Comment

ID: 38401065
If you think it is Apache, check the error log.

Assisted Solution

by:Alicia St Rose
Alicia St Rose earned 498 total points
ID: 38402842
Where are these images NOT showing up? Are they in widgetized areas? I find that I have to manually change those.
And did you do a query in your database using this:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

Open in new window

It's not a good idea to search and replace the URL in the .sql file because there's some character number issues that can arise, something about new url not having same characters count as old one. Make your changes in PhpMyadmin.

And even after this query you'll still have to change manually anything that's in a text widget or some plugins...
LVL 70

Expert Comment

by:Jason C. Levine
ID: 38407403
It's not a good idea to search and replace the URL in the .sql file because there's some character number issues that can arise, something about new url not having same characters count as old one

That issue is resolved if you disable, then rebuild, permalinks as described in the article.  But you are basically correct...it's a checksum that WP runs.

Expert Comment

by:Alicia St Rose
ID: 38410590
Thanks jason1178. I remember that!

Author Closing Comment

ID: 38410649
I want to thank all who helped resolve my WP issue. I've read all linked pages and followed all suggestions with a certain degree of success. It ends up being too much effort for what I'm trying to achieve. I'm going to take a different approach, one which I wouldn't have arrived at had I not received all the expert help.

So, I'm splitting the points three ways. Thanks again for all your valuable information!

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month17 days, 22 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question