Hello Ben,
The method used to store passwords in OJS has changed since 1.x. OJS 1.x used MySQL's ENCODE and DECODE functions to store passwords, while OJS2 uses MD5 or SHA1 (as configured in config.inc.php, with MD5 as the default).
You can extract the passwords from OJS 1.x as follows:
1. Get the password salt from MySQL:
- Code: Select all
SELECT chPasswordSalt FROM tbljournalconfig;
2. Use the password salt to get the passwords.
- Code: Select all
SELECT chUsername, decode(chPassword, '(salt goes here)') AS password FROM tblusers;
If OJS 2.x is configured to use MD5 hashing for passwords, you can use MySQL's md5(...) function to generate the new password hash. Concatenate the username and password and generate the hash. For example:
- Code: Select all
UPDATE users SET password=md5(concat(username, '(new password goes here)')) WHERE username='(username goes here)';
An easier way to accomplish all of this is to use the migration tools to bring an entire OJS 1.x journal into OJS 2.x; however, this will also bring across the journal settings, articles, submissions, etc, so you'll have to clean up afterwards if all you want is the users.
Regards,
Alec Smecher
Open Journal Systems Team