Migrate doesn't update destination files if source files have changed content I'm using Migrate 7.x-2.5 to keep Commerce products synchronized between a legacy system and a Drupal ecommerce website.

I setup two migration methods, one for Commerce Products entities and one to generate nodes for product display. Migration tasks are supposed to be run every night, because people during the day add new products, update some, and delete others. So both migration tasks are run with the "update" checkbox checked. I take care to delete obsolete content at postImport() and all is good.

Everything is working for me, except for product images. When source files are updated with different pictures, filename doesn't change (that's a legacy system behaviour). Migrate doesn't seem to notice that the file has changed, so it doesn't migrate it and pictures don't get updated.

Anyone can help dealing with this file updating issue?

Here's the relevant migration part where files are handled.

$this-&gt;addFieldMapping('field_image', 'immagine'); //this field gets populated in prepareRow()
$this-&gt;addFieldMapping('field_image:file_class')
        -&gt;defaultValue('MigrateFileUri');
$this-&gt;addFieldMapping('field_image:source_dir')
        -&gt;defaultValue(SRC_IMG_PATH);
$this-&gt;addFieldMapping('field_image:file_replace')
        -&gt;defaultValue(FILE_EXISTS_REPLACE);
It turns out that files are actually updated. So there's nothing to edit in my migration code.

Problem is that a flush on image styles is required. 

I was triggering flush manually, but I could not see updated images in webpages.

Flushing was not working due to file permissions on resized images, so I still see the old "styled" images.