My migration is from a legacy D6 database towards the OpenPublish (OP) distribution. OP makes use of profiles for many nodes. I have two questions:

1) Howto populate the Profile Node with User data within migrate_d2d? My node_arguments (as per the migrate_d2d example provided in the source) is as follows:

array(
      'class_name' => 'ProfileMigration',
      'description' => t('Migration of profile nodes from Drupal 6'),
      'machine_name' => 'Profile',
      'source_type' => 'User',
      'destination_type' => 'profile',
      'dependencies' => array('User'),
    ),

But surely this doesn't work. When I run Drush ms it tells me there are zero nodes waiting to be imported

2) How do I make sure that the nodes who make use of this profile functionality will have the uid set to 1 (admin)? Is this a simple mapping such as:

$this->addFieldMapping('uid')->defaultValue(1);

Or will this create problems with the internal setup of migrate_d2d?

Comments

mixhael’s picture

Think I've fixed this issue too.

Removed this in the .module:

array(
      'class_name' => 'ProfileMigration',
      'description' => t('Migration of profile nodes from Drupal 6'),
      'machine_name' => 'Profile',
      'source_type' => 'users',
      'destination_type' => 'profile',
      'dependencies' => array('User'),
    ),

Added this in the same file:

Migration::registerMigration('ProfileMigration', $arguments['machine_name'],
                               $arguments);

Then changed the class in node.inc according the following:

class ProfileMigration extends DrupalUser6Migration {
  public function __construct(array $arguments) {
    parent::__construct($arguments);

    $this->destination = new MigrateDestinationNode('profile');

  }
}

Will test this out and give feedback on it's workings...

mixhael’s picture

sorry, *deleted this*, replied in the wrong thread

mixhael’s picture

Sorry, can only test this properly when the issue here is fixed: http://drupal.org/node/1813672

mikeryan’s picture

Category: feature » support
Status: Active » Closed (duplicate)

See #1809484: How to migrate from D6 node to D7 term? for a similar question - the principle would be the same.

mixhael’s picture

Thanks, that works for me