Support a means of rerunning a migration process to update the migrated content in place, instead of clearing and re-importing.

See also #429306: Create content sets for updating existing content

Comments

mikeryan’s picture

The initial implementation of this feature will only be exposed via drush - see Migrate module workflow refactoring. I have this basically done for nodes, it needs more testing and application to other destination types, but I expect to commit it within a few days.

mikeryan’s picture

Assigned: Unassigned » mikeryan
Status: Active » Fixed

Committed. This feature is only available through Drush at this time (add a "--update" flag to the migrate import command).

pabloid’s picture

Status: Fixed » Active

Am I wrong or it seems to have a strange behaviour?
I tried the --update option with drush but I noticed this:
- if the source content title changed, after the re-import on drupal the node title is update in node table, but not in node_revision table.
- update on body field seems to not working.

Anyway, thanks for the great work you're doing here.

mikeryan’s picture

Thanks for picking that up - when updating and not creating a new revision, the node object needs to have the vid present. I'll commit this fix within a day or two with #650472: Workflow refactoring, in the meantime you can modify the beginning of node_migrate_import_node() to look like this:

  $node = new stdClass;
  $node->type = $tblinfo->desttype;
  // Handle the update case
  if ($row->destid) {
    $node->nid = $row->destid;
    // Need to have the current vid present
    $node->vid = db_result(db_query("SELECT vid FROM {node} WHERE nid=%d", $row->destid));
  }
mikeryan’s picture

Status: Active » Fixed

Committed as part of #650472: Workflow refactoring.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.