Migrating vBulletin Users with vbulletin_users.inc
Last updated on
30 April 2025
After vBulletin Roles Migration we can migrate the vBulletin users.
The following was added to the vbulletin_user.inc
Database::addConnectionInfo('for_user_migration', 'default', array(
'driver' => 'mysql',
'database' => 'mysite_vbdatabase',
'username' => 'mysite_d7user',
'password' => 'myd7userpassword',
'host' => 'localhost',
'prefix' => 'vb_',
));
class vBulletinUserMigration extends vBulletinMigration {
public function __construct() {
parent::__construct();
$this->description = t('Migrate vBulletin users');
// Set the source table's primary key
$this->map = new MigrateSQLMap(
$this->machineName,
array(
'userid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'watw Unique user ID',
'alias' => 'u',
),
),
MigrateDestinationUser::getKeySchema(),
'for_user_migration'
);
// Set the query to get the source object
$query = Database::getConnection('default', 'for_user_migration')
->select('user', 'u')
->fields('u', array(
'userid',
'usergroupid',
'membergroupids',
'displaygroupid',
'username',
'password',
'passworddate',
'email',
'styleid',
'parentemail',
'icq',
'aim',
'yahoo',
'msn',
'skype',
'showvbcode',
'showbirthday',
'usertitle',
'customtitle',
'joindate',
'daysprune',
'lastvisit',
'lastactivity',
'lastpost',
'posts',
'reputation',
'reputationlevelid',
'timezoneoffset',
'pmpopup',
'avatarid',
'avatarrevision',
'profilepicrevision',
'options',
'birthday',
'birthday_search',
'maxposts',
'startofweek',
'ipaddress',
'referrerid',
'languageid',
'emailstamp',
'threadedmode',
'autosubscribe',
'pmtotal',
'pmunread',
'salt',
'adminoptions',
'lastpostid',
'sigpicrevision',
'ipoints',
'infractions',
'warnings',
'infractiongroupids',
'infractiongroupid',
'profilevisits',
'friendcount',
'friendreqcount',
'vmunreadcount',
'vmmoderatedcount',
'socgroupinvitecount',
'socgroupreqcount',
'pcunreadcount',
'pcmoderatedcount',
'gmmoderatedcount'
));
$count_query = Database::getConnection('default', 'for_user_migration')
->select('user', 'u');
$count_query->addExpression('COUNT(userid)', 'cnt');
$this->source = new MigrateSourceSQL($query, array(), $count_query, array('map_joinable' => FALSE));
$this->destination = new MigrateDestinationUser();
// Make the mappings
$this->addFieldMapping('name', 'username')
->description('Map vBulletin username to Drupal username.');
$this->addFieldMapping('mail', 'email')
->description('Import single vBulletin email field to both init and mail D7 fields');
$this->addFieldMapping('created', 'joindate')
->description('Map vBulletin join date to Drupal user created date field.');
$this->addFieldMapping('access', 'lastvisit');
$this->addFieldMapping('roles', 'usergroupid')
->separator(',')
->sourceMigration('vBulletinRoles');
$this->addFieldMapping('login', 'lastvisit');
$this->addFieldMapping('init', 'email')
->description('Import single vBulletin email field to both init and mail D7 fields');
$this->addFieldMapping('pathauto')
->description('Set to 0 for now');
$this->addFieldMapping('status')
->description('Can we import the vBulletin frozen usergroup with id 8 to have a blocked status in D7')
->issueGroup(t('Implementor Issues'))
->issuePriority(MigrateFieldMapping::ISSUE_PRIORITY_MEDIUM)
->issueNumber(0004);
$this->addFieldMapping('pass')
->description('I think vBulletin 3x uses a salted MD5 and the old site also used a vBDrupal bridge so may be issues with D5 and D6 passwords to migrate to D7 but vBtoDrupal vbpassword module may help')
->issueGroup(t('Implementor Issues'))
->issuePriority(MigrateFieldMapping::ISSUE_PRIORITY_MEDIUM)
->issueNumber(0005);
$this->addFieldMapping('timezone')
->description('Not sure how to translate vBulletin timezoneoffset integers of + and - default or GMT timezone to D7 region timezones')
->issueGroup(t('Implementor Issues'))
->issuePriority(MigrateFieldMapping::ISSUE_PRIORITY_MEDIUM)
->issueNumber(0006);
$this->addFieldMapping('language')
->description('Not sure how to translate vBulletin languageid integer to D7 language field')
->issueGroup(t('Implementor Issues'))
->issuePriority(MigrateFieldMapping::ISSUE_PRIORITY_MEDIUM)
->issueNumber(0006);
$this->addFieldMapping('path')
->description('Need redirect from vBulletin user link to best for SEO user path alias in D7')
->issueGroup(t('Implementor Issues'))
->issuePriority(MigrateFieldMapping::ISSUE_PRIORITY_MEDIUM)
->issueNumber(0007);
$this->addFieldMapping('is_new')
->description('is_new is probably the best option but not sure')
->issueGroup(t('Implementor Issues'))
->issuePriority(MigrateFieldMapping::ISSUE_PRIORITY_MEDIUM)
->issueNumber(0008);
$this->addFieldMapping('birthday')
->description('vBulletin birthday format needs attention to import into D7')
->issueGroup(t('Implementor Issues'))
->issuePriority(MigrateFieldMapping::ISSUE_PRIORITY_MEDIUM)
->issueNumber(0009);
// Unmapped source fields
$this->addUnmigratedSources(array(
'userid',
'usergroupid',
'membergroupids',
'displaygroupid',
'username',
'password',
'passworddate',
'email',
'styleid',
'parentemail',
'icq',
'aim',
'yahoo',
'msn',
'skype',
'showvbcode',
'showbirthday',
'usertitle',
'customtitle',
'joindate',
'daysprune',
'lastactivity',
'lastpost',
'posts',
'reputation',
'reputationlevelid',
'timezoneoffset',
'pmpopup',
'avatarid',
'avatarrevision',
'profilepicrevision',
'options',
'birthday_search',
'maxposts',
'startofweek',
'ipaddress',
'referrerid',
'languageid',
'emailstamp',
'threadedmode',
'autosubscribe',
'pmtotal',
'pmunread',
'salt',
'adminoptions',
'lastpostid',
'sigpicrevision',
'ipoints',
'infractions',
'warnings',
'infractiongroupids',
'infractiongroupid',
'profilevisits',
'friendcount',
'friendreqcount',
'vmunreadcount',
'vmmoderatedcount',
'socgroupinvitecount',
'socgroupreqcount',
'pcunreadcount',
'pcmoderatedcount',
'gmmoderatedcount'
));
// Unmapped destination fields
$this->addFieldMapping('signature') ->description(t('vBulletin long text signature to be replaced with one text and one link field in D7'))
->issueGroup(t('DNM'));
$this->addFieldMapping('signature_format') ->description(t('Will be set manually'))
->issueGroup(t('DNM'));
$this->addFieldMapping('picture') ->description(t('Will be reset in D7 to create new size and image types with imagecache'))
->issueGroup(t('DNM'));
$this->addFieldMapping('field_migrate_example_gender') ->description(t('Not used in vBulletin but might be a new field in D7'))
->issueGroup(t('DNM'));
$this->addFieldMapping('theme') ->description(t('Not used in vBulletin and themes will be different in D7'))
->issueGroup(t('DNM'));
$this->addFieldMapping('field_signature_link') ->description(t('vBulletin long text signature to be replaced with one text and one link field in D7'))
->issueGroup(t('DNM'));
}
}
As with vBulletin Roles Migration, the above includes a long list of fields that aren't need in my D7 site so they won't be migrated with ->issueGroup(t('DNM'));
There are probably also many fields that might not be in your own vBulletin setup, depending on any addons/plugins that you might have installed in vB
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion