WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Images do not show after moving site from localhost to server (7 posts)

  1. Dong Suzuki
    Member
    Posted 2 years ago #

    After I transferred my XAMPP site onto my iPage server, everything is okay except the images. All images do not show up. Here is my site: http://www.sudongyue.com/writing. I believe there must be something in the database that are still pointing to the my localhost instead of my server.

    Here is what I did with the database. I exported localhost database .sql file and imported it into my server's database, then in the wp-option, I changed the siteurl and home from localhost to server.

    Since the images not working, I try another way. In the localhost database.sql file, I did a search and replace "localhost/.../wordpress." and then imported it into the server phpmysql. It did not work. The site was messy.

    How to fix this? Please help. It is driving me crazy. It does not seem to be a complicated problem, but I have been searching answers and none of them work.

  2. Tarsem Singh
    Member
    Posted 2 years ago #

    Change the URL by php @see http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-queries-you-wish-you-knew-earlier/

    also make sure all upload are same as Localhost in wp-comntent/uploads..

  3. Dong Suzuki
    Member
    Posted 2 years ago #

    Thanks a lot! I ran the SQL query as the link suggests, and yet it does not work. As the link says, I updated the guid and post_content. I did update the image related query as well but there is a confusion. The link says:

    Change Image Path Only

    If you decide to use Amazon CloudFront as your Content Delivery Network (CDN) to offload the delivery of images from your server. After your have created your CNAME record, you can use the query below to change all the image paths in WordPress to load all your images from Amazon CloudFront.

    Solution:
    UPDATE wp_posts SET post_content = REPLACE (post_content, 'src="http://www.oldsiteurl.com', 'src="http://yourcdn.newsiteurl');

    What is Amazon CloudFront? I did not use it in my localhost. So what I did was, instead of yourcdn.newsiteurl, I put http://www.sudongyue.com/writing, which is my newsiteurl. However, nothing got updated. Did I do anything incorrectly?

    By the way, I double checked the wp-content/uploads, all the images are there in the server folder under this directory, same as my localhost. I used FTP client to move the wp_content folder from localhost to my server. So I think this is not the culprit.

  4. Dong Suzuki
    Member
    Posted 2 years ago #

    Just to add: for my oldurl I put localhost/writing/wordpress, and my new url I put http://www.sudongyue.com/writing.

  5. Dong Suzuki
    Member
    Posted 2 years ago #

    Hey it works!!! Sorry I overlooked something. I think it is the guid that makes the change. Thanks!

  6. nizamkza@yahoo.com
    Member
    Posted 2 years ago #

    I am having the same issue with my images, and with my posts as well...Please can you assist me and tell me how u resolved this.

  7. chrissmit
    Member
    Posted 1 year ago #

    I had the same problem, but solved it.

    I had moved my site (same host, different URL).

    In order to change all the internal WP links, I used a nice plugin called Velvet Blues Updates: http://wordpress.org/extend/plugins/velvet-blues-update-urls/

    Install this, but FIRST make a back up of your database.
    Then check the options you want/need changed.

    Mind you that it might make a difference if you put in your Old and/or New URL with WWW or without www.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.