Replace the file on disk while running the migration
As a temporary fix I have implemented the following in the prepareRow function.

function prepareRow($row) {
  // Delete the file if already present.
  $file_path = drupal_realpath($row-&gt;dest_dir . '/' . $row-&gt;name);
  if (file_exists($file_path)) {
    unlink($file_path);
  }
}


However, I am still not sure about the way it is recommended in the Migrate module.