問題描述
將 AspNetSqlMembershipProvider 用戶遷移到 WebMatrix (Migrate AspNetSqlMembershipProvider users to WebMatrix)
I looking for a tool can migrate my users from AspNetSqlMembershipProvider
user to WebMatrix.WebData.WebSecurity
. I want to host my site on Azure and have a lot of trouble with the AspNet stored procedure.
It seem easy to export data from one table to another but not with the password. How can I do the task It must be transparent for my end users.
Thanks!
參考解法
方法 1:
If the password is the only obstacle, don't worry. In fact, we cannot and do not need to know the passwords themselves. In most of the system, the passwords are encoded and saved in a table. In asp.net mvc4 SimpleMembershipProvider, the table is called webpages_membership. In this table, 2 columns are the keys: Password and PasswordSalt. I know nothing about AspNetSqlMembershipProvider, but I think there must be a corresponding table which contains the 2 columns with similar names. Migrating data in these 2 columns should make it work.
I suggest to do it as following:
- Create a new account in the old system with a password.
- Create a new account in the new system with a different password.
- Overwrite the Password/PasswordSalt in the new system by those in the old system.
- Try to log in new system with password of the old system.
- If it succeeds, it proves that the two systems are using the same machanism then and you can do the whole migration work.
Detailed algorithm can be found here: http://www.jasypt.org/howtoencryptuserpasswords.html