I'm moving from expressionengine to symfony2 and I'm looking for the best way to migrate the user passwords. The goal is to let legacy users log in with their existing credentials, while passwords for new users are created the default way.
I have looked at custom authentication providers and custom user providers and thought about wether or not to create a separate entity for the legacy users, but I don't know what'd be the best way/design to achieve the above.
FYI:
- As far as I can see, expressionengine just encrypts the password using sha1 and that's it.
- I am currently using FOSUserBundle.
Can anyone advice me on a solution?
Maybe the thread about exporting members from ExpressionEngine to Wordpress will help you.
I don't see any difficulties other than exporting the results from a custom query to the FOSUserBundle structure.
Important things to remember:
Figured it out!
Create a custom encoder and use FOSAdvancedEncoder bundle to select the appropriate encoder.
1. Create the encoder
2. Register your encoder as service
3. Install FOSAdvancedEncoderBundle
Look here: https://github.com/friendsofsymfony/FOSAdvancedEncoderBundle/blob/master/Resources/doc/index.md
4. Configure your encoders
In
app/config.yml
:5. Implement the encoder aware interface in your User Class
Remember to add a boolean field to administer if a user is a legacy user or not.
That's it.