I'm in the process of moving across an old, custom-built discussion forum into Drupal (4.7), and have successfully imported the user profiles from the old database into Drupal's mysql user table.
Now, the problem I have is that the passwords are in plain text, and I can see from browsing around the forums here that the passwords are stored in the database after having gone through some sort of md5 hash encryption (apologies for incorrect use of terminology here, I am very much a novice in this particular area).
Is there any way I can update all those passwords to be in the appropriate format?
Ideally, when we switch from the old forum to the new, we can allow people to log in to the drupal-based forums using their existing login/pw.
Comments
If you have already created
If you have already created your users in Drupal's users table then you can change their passwords by using only 1 SQL Query.
UPDATE user SET pass = MD5(pass)
--------------------------------------------------------------
http://www.students.itu.edu.tr/~koseer/drupal/ - works on PHP-TXT-DB database layer.
perfect. thanks.
perfect. thanks.
md5
How are you importing the user data into Drupal's database? Manually, one by one? Using PhpMyAdmin? Or by using some kind of script?
In PhpMyAdmin, simply paste the plain text password in the
pass
field, and selectMD5
from the function dropdown list.If you're using a PHP script, you can use
$hash = md5('plaintxtpwd');
and thanks for those hints
and thanks for those hints too.
FYI: I did the whole transfer by dumping the user database to a text file, which I fiddled with a bit to create a bunch of INSERT statements that I loaded into the Drupal database via phpmyadmin.