I don’t really need to import any data into my D7 build other than users. I have (by SQL) imported my user data however, the D7 password encryption method is now different.
I’m not an expert by any stretch of the imagination and I’ve never used Drush, but I have come across this user_update_7000 code snippet found user.install (http://api.drupal.org/api/drupal/modules–user–user.install/function/user_update_7000/7)
<?php
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
$old_hash = md5('password');
$hash_count_log2 = 11;
$new_hash = user_hash_password($old_hash, $hash_count_log2);
if ($new_hash) {
// Indicate an updated password.
$new_hash = 'U' . $new_hash;
}
?>
Where could I run this script in order to update the password field in my DB?
Thanks,
Steve
I think you can create a page named something like rehash.php (in your root, same place as update.php). Then, log in as administrator first, browse to this page second. See code below (most taken from user_update_7200 in the latest drupal 7 install)…
Worse case, you could create a simple custom module and put this code in there.
Please note that you should back things up first: