Community Documentation

User migration

Last updated October 22, 2012. Created by mikeryan on October 22, 2012.
Log in to edit this page.

The user migration classes support not only the core user properties like mail, name, etc., but also fields added by the core profile module, the Drupal 6 Content Profile module, or Drupal 7 custom fields. They take the following arguments:

  • role_migration: The machine name of your role migration class, if any - used to set up dependencies and to properly map role assignments. If omitted, role assignments will not be migrated (they will default to authenticated user).
  • picture_migration: The machine name of your picture migration class, if any. See below for a description of picture migration classes.

<?php
$user_arguments
= $common_arguments + array(
 
'machine_name' => 'ExampleUser',
 
'description' => t('Import Drupal 6 users'),
 
'role_migration' => 'ExampleRole',
 
'picture_migration' => 'ExamplePicture',
);
Migration::registerMigration('DrupalUser6Migration',
 
$user_arguments['machine_name'], $user_arguments);
?>

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 7.x
Audience
Programmers
Level
Intermediate, Advanced
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.