MyBB Community Forums

Full Version: Import Passwords
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to import a bunch of users. The usernames are easy, but how can I import the passwords?
Since the passwords were hashed in your other table, it is impossible to re-hash them with MyBB.
The passwords are already re-hashed. I basically have a long list of usernames and passwords (I can see the passwords). I'm wondering if there's a way I can enter them into the database. I could enter them all manually through mybb, but it would take a long time.
The password has to be md5() once.
The salt is generated using generate_salt();. The salted password is used be combining the password and the salt salt_password($md5password, $salt);. The login key is generated by using generate_loginkey().
You then insert/update the user using the columns
password = $salted_password, salt = $salt, loginkey = $login_key

As long as the passwords are either plain text or md5'ed once, you can reconstruct the passwords. If not then you will need to resend all your users a random password.
If you md5 all of the paswords once, then set the "salt" and "loginkey" fields in the database to blank, MyBB will generate the salt and login key, as well as update their password when they next login.