This code was created as an example of doing a Custom Drupal-to-Drupal Migration starting with migrations generated by the Migrate Plus module and then modifying them.
Currently, this migration will import content types, nodes of type blog_post
and users that have authored a blog.
This is done via a custom source plugin that extends Drupal\user\Plugin\migrate\source\d7\User
.
The Migration Group is defined in migrate_plus.migration_group.dmeblog_migrate.yml, the database schema key is defined as:
shared_configuration:
source:
key: migrate
So, in your Drupal 8 site's settings.php
, define your database creds like so:
Note Your database, user and password may be different :)
$databases['migrate']['default'] = array (
'database' => 'dmed7',
'username' => 'dmed7',
'password' => 'dmed7',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
Make sure that the admin username in your Drupal 8 site you are importing to, does not exist in the usernames you'll be importing.
After importing a fresh backup of your Drupal 8 install, enable your module and check migration status:
drush en dmeblog_migrate -y && drush migrate-status
Run the migration:
drush migrate-import --all