In case someone else is looking...

The default Drupal users table has a column called data which stores a serialized array of fields and values. This data field isn't included with the normal fields provided by MigrateDestinationUser::getKeySchema() and I wasn't able to find any documentation for migrate that demonstrated how to populate this field. I dug around in the code and after a little trial and error came up with the following function which should be added in your user migration class:


public function prepare(stdClass $account, stdClass $row) {
  $account->data = array('field1' => 1, 'field2' => 2);
}

Comments

mikeryan’s picture

Component: Code » Documentation
Status: Active » Fixed

This is the simplest way to migrate the 'data' data:

    $this->addFieldMapping('data', 'data')
         ->callbacks('unserialize');

The best place to add hints and tips would be under http://drupal.org/node/1007002, not in the issue queue.

Status: Fixed » Closed (fixed)

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