A number of ubercart tables use nid as a foreign key, as far as I can tell the nid conversion is stored in a migrate_map_NODETYPE table. I have more than 30 node types 18 of which are product types. Is there one table that maps the old node ID to the new nod ID, or do I have to check each table?

uc_product_adjustments is just one of the tables where this foreign key is used.

    $this->addFieldMapping('nid', 'nid')
         ->sourceMigration('????????');

The alternate to the sourceMigration is to determine the node type first and then search for the proper node id in the proper migrate_map_NODETYPE table probably in prepareRow().

This problem is specific to table migrations, not node migrations.

Comments

pcher1bw’s picture

Issue summary: View changes
mikeryan’s picture

Status: Active » Fixed

Each migration has its own map table, there is no uber map table. However, to search multiple migrations to resolve a reference, simply pass an array of the possible source migrations (see https://www.drupal.org/node/1133448#sourcemigration):

$this->addFieldMapping('nid', 'nid')
         ->sourceMigration(array('Articles', 'BlogPosts', ...);

Status: Fixed » Closed (fixed)

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