preserve nids during a migration

This is actually easy to do. In the prepare() function of the node migration class, just set the nid and is_new to true:

  1. public function prepare($node, $row) {
  2. // Preserve old nid so that old links to nodes using /node/nid still work
  3. $node->is_new = TRUE;
  4. $node->nid = $row->nid;
  5. }


Article Information
Article ID Categories Tags Levels Status
#39
Free
Open