Migrate users and retain passwords I'm transferring 10K users from Drupal 7 to Drupal 8. I want to retain passwords. What I'm trying is


Dump user records from Drupal 7 as a CSV file
Dump hashed passwords from MySQL as a CSV file
Load user records and hashed passwords into a custom program
In the program, add hashed passwords to the correct user records (match by UID)
Manipulate user records (consolidate duplicates, combine fields, and more)
output fixed-up user records (including password hash) to a CSV file
use this CSV file as input to a custom Drupal 8 module to create users


All of this is easy except creating users in Drupal 8 with their Drupal 7 passwords.

I have tried simply

$values = array
[
  'name' =&gt; 'test',
  'mail' =&gt; 'test@test.com',
  'roles' =&gt; [],
  'pass' =&gt; $hashed_drupal_7_password,
  'status' =&gt; 1,
];
$account = entity_create('user', $values);
$account-&gt;save();


but of course Drupal 8 assumes the pass value is the textual password and rehashes it.

Is there a way to get the already-hashed password into the user account, either during creation or after it is created? If I get them in, will they still work? As you can tell by reading, I'm a neophyte when it comes to passwords, encryption, etc. I've read many posts and articles, but don't recognize an answer to this question.
As @No Sssweat recommend, the D8 Migrate Modules is good way. With your way, you have to add property pre_hashed for field pass.

$values = [
  'name' =&gt; 'test',
  'mail' =&gt; 'test@test.com',
  'roles' =&gt; [],
  'pass' =&gt; [
    'value' =&gt; $hashed_drupal_7_password,
    'pre_hashed' =&gt; TRUE,
  ],
  'status' =&gt; 1,
];
$account = entity_create('user', $values);
$account-&gt;save();


You can find this property in FieldType Password