I have been using the migrate module to migrate users from Drupal 7.59 to Drupal 7.59. I encounter the following error.
Migration for <em class="placeholder">NonDomainUserMigration</em> failed with source plugin exception: <em class="placeholder">SQLSTATE[42S22]: Column not found: 1054 [error]
Unknown column 'pgid' in 'on clause'</em>, in <em class="placeholder">/app/includes/database/database.inc</em>:<em class="placeholder">2227</em>
What could be the issue? I can't find any pgid column in the drupal database.
the following is my User migration code
<?php
abstract class NonDomainBaseMigration extends Migration {
// A Migration constructor takes an array of arguments as its first parameter.
// The arguments must be passed through to the parent constructor.
public function __construct($arguments) {
parent::__construct($arguments);
// With migrate_ui enabled, migration pages will indicate people involved in
// the particular migration, with their role and contact info. We default the
// list in the shared class; it can be overridden for specific migrations.
$this->team = array(
new MigrateTeamMember('Moses Liao', '[email protected]',
t('Tech Lead')),
);
Database::addConnectionInfo('legacy', 'default', array(
'driver' => 'mysql',
'database' => 'zaobao_drupal',
'username' => 'root',
'password' => 'password',
'host' => 'mysqldb',
'prefix' => '',
));
}
}
class NonDomainUserMigration extends NonDomainBaseMigration {
public function __construct($arguments) {
parent::__construct($arguments);
$this->description = t('Legacy Zaobao Drupal 7 system Users');
$query = Database::getConnection('default', 'legacy')
->select('users', 'u')
->fields('u');
$this->source = new MigrateSourceSQL($query);
$this->destination = new MigrateDestinationUser();
$source_key = array(
'pgid' => array('type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => t('Source ID'),
)
);
$this->map = new MigrateSQLMap($this->machineName, $source_key,
MigrateDestinationNode::getKeySchema(), 'legacy', array('track_last_imported' => TRUE));
$this->addSimpleMappings(
array(
'uid',
'name',
'pass',
'mail',
'theme',
'signature',
'signature_format',
'created',
'access',
'login',
'status',
'timezone',
'language',
'picture',
'init',
'data',
)
);
}
}