Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to import more than 1000 users from joomla to wordpress. I can do that with csv. My main concern are passwords. I did some googling and found out that it is possible to change wordpress password formats.

Can anyone show me some code examples how to do that?

share|improve this question
    
Could you please clarify what do you mean by password format? How passwords are hashed for storage in database? –  Rarst Mar 20 '11 at 14:06

2 Answers 2

up vote 9 down vote accepted

First of all you need to find out which hashing algorithm has been used on the Joomla site to store the passwords. Joomla - different to Worpdress - ships with a variety of hashing algorithms.

If you have found out how the hashes have been generated, you can port the hashing function over into wordpress and make use of a pluggable function called wp_check_password() to check against the password hash.

Pluggable function means, that you can define a function with the same name inside your own plugin-in, so to overwrite the standard functionality.

Now here is the simple trick:

You compare against both, the Joomla hash and the Wordpress one (PHPASS). Additionally you can take care of MD5 as well (the old Wordpress hashing algorithm).

If a user logs in with a password that is in the old hash format, you update the users hash in the database with the standard wordpress hash (PHPASS). So each user that logs in will be automatically converted.

The current wp_check_password() function btw. does already something similar.

So what you need is

  1. Find out which algorithm was used to generate the hashes.
  2. Port that algorithm over to worpdress, so you can invoke it per one function.
  3. Extend the wp_check_password() function to test against Joomla hashes as well.
share|improve this answer
    
Thanks! It seems that I got everything to work. –  Märt Rang Mar 21 '11 at 22:33

There are some plugins to bulk reset passwords. I think that's some solution.

Here's the link to the pluggable functions reference at the Codex. You'll find all kind of functions like eg. wp_salt, wp_hash, etc. Maybe you're searching for a combination of wp_check_password & wp_generate_password

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.