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?
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
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