OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



importing old users

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

importing old users

Postby bunswo » Fri Oct 14, 2005 1:23 pm

Hi,
I was wondering if you could tell me the best way to import old users from OJS 1 to OJS 2.1

I only really need their names, usernames, email and password... and the only thing I guess I'm not quite sure how to do is retain the passwords. I figure I can just export the fields with PHP MyAdmin into an excell sheet and then reformat it to correspond to the new fields in the new version. What I'm not sure about is if the old user passwords will still work?

Thanks,
Ben
bunswo
 
Posts: 6
Joined: Mon Aug 15, 2005 1:57 pm

Postby asmecher » Mon Oct 17, 2005 3:07 pm

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
asmecher
 
Posts: 8815
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 5 guests