Drupal 6 user password import to Drupal 7

后端 未结 3 950
情书的邮戳
情书的邮戳 2021-02-06 09:30

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.

3条回答
  •  没有蜡笔的小新
    2021-02-06 09:59

    This answer was perfect. I used it to update from a Drupal 5 site. I made a couple of changes to suit my purposes:

    1. I didn't limit the number of passwords that get updated. I wanted all of them updated, and the system I was updating had many more than 1,000 users.

    2. I added a check to make sure I wasn't updating a password twice. This way, if it times out (as it did for me) modifying all the passwords, I can rerun the rehash.php to complete the conversion. Be aware, though, that once a user logs in, the leading "U" is removed when the password is re-hashed.

      if (substr($account->pass, 0, 1) == 'U')
      {
          continue;
      }
      

提交回复
热议问题