Do not map (update) some fields with migrate in update action I have a custom migrate import that imports some fields like:

...
$this-&gt;addFieldMapping('title', 'title');
$this-&gt;addFieldMapping('body', 'description');
$this-&gt;addFieldMapping('created', 'created');
...


If I run an update of some items (the source data is a live site) I don't want to update the title or body fields because editors are changing this content in the drupal site.

I'm using this workarround but I'm not sure this is the best way to do this:

/**
 * Migrate prepare method.
 */
public function prepare($entity, $row) {
  if (isset($entity-&gt;is_new) &amp;&amp; $entity-&gt;is_new === FALSE) {
    unset($entity-&gt;body);
    unset($entity-&gt;title);
  }
}


Thanks!
Good news! You are doing this exactly right. By "unsetting" the fields in the source data you are taking the proper approach. This practice is common and the relative snippet of documentation is buried a bit in the Migrate Handbook:


  To use default values for NULL or '' or array() values, be sure to remove the item with unset() in your prepareRow() [or prepare()] function.


From https://www.drupal.org/node/1133448

Good luck with the migration!