1

After migrating a site from the live server to my test server (different URL), some of the images (not all) are not displaying. The src is correct, image is in the uploads folder, and everything looks good in the database. However, the image does not appear. Again it's only "some" of the images and not all. Other images within the same folders, e.g. wp-content/uploads/2013/09/, are being loaded correctly.

Ideas?

P.S. And the rest of the content is correct.

UPDATE: Found out that all images that are affected include é within the image's filename. Once I copied the filename into the post and meta tables, it worked. Not sure why?

  • How did you migrate it? – Andrew Bartel Mar 1 '14 at 0:10
  • How did you change the internal links? – Brad Dalton Mar 1 '14 at 0:38
  • If you were to use chrome and firefox and inspect the image element, could you click on the image path and see it? – gdaniel Mar 1 '14 at 1:02
  • @gdaniel Path is absolutely correct in the image src and in the Media library. Puzzling. – Julie CodeRiver Mar 1 '14 at 1:17
  • @AndrewBartel Fresh WordPress install, updated wp-config after creating db, loaded all of wp-content (including the images). Exported db from live site. Imported db into test server. Ran search replace in the db using as brad-dalton mentions below, as well as did a manual SQL update when that didn't solve the issue (i.e. but only after dumping and reloading the db). And saved the permalinks. – Julie CodeRiver Mar 1 '14 at 1:20
1

I highly recommend updating all of your URLS.

  • This can be done either with a word press plugin such as Velet Blues Update URLS
  • Or via your SQL database:
    UPDATE wp_posts set post_content=REPLACE(post_content, 'www.live.com/', 'www.test.com/');

note* images are uploadeded as posts in your database.* ( wp_posts table with a post_type of "attachment". )

0

I would install a plugin like WP Migrate DB and enter the new server path and site address before exporting the database from your live site.

Otherwise, you can run a script like this one on your local installation https://github.com/interconnectit/Search-Replace-DB

  • I used search-replace as you indicated, as I always do. Also did it manually in SQL after reloading the tables. No difference. – Julie CodeRiver Mar 1 '14 at 1:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.