Migrate : Update not working Im using the migrate module to import data from a json feed.
Mostly work fine however, i require that each time the feed is imported , updated records in the source are updated in the destination if they exist.

Im struggling to find much information on this or more over explicitly how to implement this kind of functionality.

I have list my code to date and would really appreciate any input someone has on this.
An example might be the same feed being imported but the aboutOurClient field updated in the source

cheers

Steve

class JSONMigration extends Migration {
  /**
   * A constructor 
   */
  public function __construct() {

    parent::__construct(MigrateGroup::getInstance('json_migration'));


    $http_options = array();

    // define source definitions.... wont work with out this so hey ho
    $this-&gt;map = new MigrateSQLMap(
      $this-&gt;machineName,
      array(
        'jobref' =&gt; array(
          'type' =&gt; 'varchar',
          'length' =&gt; 255,
          'not null' =&gt; TRUE,
        ),
      ),
      MigrateDestinationNode::getKeySchema()
    );

    $fields = array(
      'jobref'                   =&gt; 'Job reference',
      'jobTitle'                 =&gt; 'Job title',
      'aboutOurClient'           =&gt; 'About the job',

    );


    $json_folder = DRUPAL_ROOT . '/' . drupal_get_path('module', 'json_migration') . '/';
    $items_url = $json_folder . 'PEsamplejson.json';

    $this-&gt;source = new MigrateSourceList(new ExampleListJSON($items_url),
      new ExampleItemJSON($items_url, array()), $fields);

    $options = array();


    $options = array('track_changes' =&gt; 1);
    $this-&gt;destination = new MigrateDestinationNode('jsontest', $options);
    //$this-&gt;systemOfRecord = Migration::DESTINATION;


    $this-&gt;addFieldMapping('field_jobref', 'jobref');
    $this-&gt;addFieldMapping('title'       , 'jobTitle');
    $this-&gt;addFieldMapping('body'        , 'aboutOurClient');




  }


  public function prepareRow($row) {
     // i can remap/manipulate here if needs be ie date
  }

}
If you are using the Migrate UI, at the bottom of the page there is an Options slideout with the Update checkbox. If you are kicking off your migration programmatically then call prepareUpdate() before calling processImport().

migrate_static_registration(array($machine_name));
$migration = Migration::getInstance($machine_name);
$migration-&gt;prepareUpdate();
$result = $migration-&gt;processImport();