I developed a website with Joomla but it grew so much that I'm going crazy trying to add new functionalities. That's why I want to redo the whole thing in ruby on rails. But my main concern right now is how to move all the users to the new rails app and let them keep their passwords. I would like the migration to be as smooth as possible, and I would like to avoid having to ask users to change their password. Does anybody have any ideas on how to achieve this?
1 Answers
Joomla 1.x and 2.x
I don't have any code for you, but you can employ the following strategy:
In your user table, add a column to indicate the hashing mechanism for the password. So all migrated users would have joomla
and new users would default to devise
. Then whenever a user attempts to log in, you would query the username and hash their password with whatever hashing mechanism is indicated in the database. If you would like to eventually migrate them all, then upon successful login you can rehash their inputted password with your new hashing mechanism (the one implemented by Devise) and update their password hash and hashing mechanism in the database.
Joomla 3.x
Judging from this other question: Joomla 3.2.1 password encryption, Joomla 3.x uses phpass which uses bcrypt. This is good news because devise also uses bcrypt to encrypt the passwords! I would verify that the passwords in your Joomla tables are encrypted with bcrypt and then migrating would be the simple task of copying the passwords verbatim to the devise users table.
-
Some good ideas right there. Definitely useful in my project. Still would need to know how to use Joomla's encryption with devise, but this is a good idea I hadn't thought about. – GuayoMena Nov 17 '15 at 14:58
-
@user2344682 I did a little more research and updated my answer. Take a look at the Joomla 3.x approach, there's a good chance that you may not have to do anything special to migrate. – Aldehir Nov 17 '15 at 18:58
-
Sounds great! I'll have to give it a try! – GuayoMena Nov 18 '15 at 13:00
-
I did try it, but the passwords in the table are completely different. The first approach looks like the only possible solution – GuayoMena Feb 03 '16 at 05:15