Finding Missing Images After Migration

Pictures in Escenic Content Engine consist of two things: a content item with fields for meta information. This content item is what you search for in Content Studio and what you can desk on your pages and relate to your articles.

These content items live in the database. However, the image files themselves live on the file system of the server running the ECE. There is one original image, typically stored under


and several generated image versions, typically stored under


Now, if you've imported a DB dump from another system and don't have the corresponding picture files so the server can find them, ECE will return status code500 (yes, not 404 as this is considered an inconsistent state of the system, take the discussion on

To find all images on a given page which return 500 and thus are missing after a DB import, I do:

$ curl -s | \
  sed 's#><#>\n<#g' | \
  grep "<img" | \
  cut -d'"' -f2 | \
  grep ^http | \
  while read f; do  \
    if [ $(curl -s -I $f | grep "HTTP/1.1 500" | wc -l) -gt 0 ]; then
      echo $(basename $f);

The next step, is to go on the system which has all the picture, find these pictures andrsync them over to the new system.

Licensed under CC BY Creative Commons License ~ ✉ torstein.k.johansen @ gmail ~ 🐘 ~ 🐦 @torsteinkrause