How to migrate Users from a CSV file in Drupal 8?
Blog

How to migrate Users from a CSV file in Drupal 8?

Migration has now become much easier in Drupal 8 compared to other previous Drupal versions. Because migration modules are in Drupal 8 core now, and it gives more flexibility to migrate the data into Drupal 8 from the previous Drupal 6 and 7 versions.  

User Migration in Drupal8 With migrate_source_csv Plugin.

In that, user migration is very important, especially if you are migrating from a Legacy system. For that, we are having a simple solution to get the users details as CSV file from the legacy system and migrate to Drupal 8. Here we are going to do the user migration from a CSV file. For doing that we need to do the following steps.

Step 1. Install the Contributed Modules required for the Migration.

We need to install Migrate Tools, Migrate Plus, Migrate Source CSV. By using drush and typing following you can install the module.

drush en migrate_tools -y 
drush en migrate_source_csv -y 

Step 2. Prepare the CSV file contains the User's data.

Here our CSV is...

Step 3. Create the Migrate configuration file and import the configuration

Create the migrate configuration files as like the following,

In migration, There are three things are the very important source, process, and destination.

Navigate to Administration > Configuration > Development > Synchronize (admin/config/development/configuration/single/import), select Migration under Configuration type and enter our migrate configuration into the Paste your configuration here window (note the absolute path to the .csv file) , and click import button.

Step 4. Go to terminal and run the following Drush commands.

  drush ms 
  drush mi demo_user_migration

No you can go back to the site and see the users by going to the path "admin/people"

Note:- When the Legacy users trying to log in, Force them to reset their passwords.

Please read more about password...https://www.drupal.org/docs/8/api/migrate-api/migrate-destination-entityuser

Other Resources : https://www.drupal.org/docs/8/upgrade/using-the-migrate-source-csv-plugin

FAQ:- Drupal 8 User Migration csv, How to add multiple role to a user?

Here our CSV is...

Create the migrate configuration files as like the following,

If you need any help to Upgrade Drupal 7 to 8, Feel Free to Talk to Us for your Enterprises

Download the Drupal Guide
Enter your email address to receive the guide.
get in touch