Posted by mikeryan on October 11, 2009 at 6:52pm
Jump to:
| Project: | Migrate |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | mikeryan |
| Status: | closed (fixed) |
Issue Summary
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
#1
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.
#2
Committed. This feature is only available through Drush at this time (add a "--update" flag to the migrate import command).
#3
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.
#4
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:
<?php$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));
}
?>
#5
Committed as part of #650472: Workflow refactoring.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.