[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Migrating ASP Users To ASP.NET

Posted on 2009-02-23
8
Medium Priority
?
211 Views
Last Modified: 2012-05-06
Hi,

I am moving my application to .net, my current application has 700 users in a sql database. I want to make use of asp.net user tables and profiles.

What would be the best way to migrate the users to the membership tables?

Thanks
0
Comment
Question by:Soluga
  • 4
  • 4
8 Comments
 
LVL 41

Expert Comment

by:guru_sami
ID: 23713149
In what format is your password stored in your current user tables?
E.g. ClearText, 2-way-Encrypted  or Hashed-1-way encrypted?
Does your app allow password Retrieval functionality?
Depending on your requirements... there could be different ways.

Depending on above answers you will have to configure your membership Provider accordingly in your web.config.

Now for Data Transfer ..

If your password is stored in clearText or Encrypted format... use some DTS feature of SQL Server(don't ask how as I have not used it) to transfer data from one table to another.

If you have or want your password to be in one-way Encryption Format i.e. Hashed Format.... your user cannot retrieve the password ...but can reset the password and get the new password.
For this thing to work... you will have to write a small app that will do the following:

Iterate through your recoreds:
1. Read data from your current user table
2. Call Membership.CreateUser (...) method and pass the user details here. This will save user info in Membership and Users table.
3. Create Profile object and save profile data for current user record you are reading.

Hope this helps.
0
 
LVL 1

Author Comment

by:Soluga
ID: 23713309
The passwords are stored as clear data, this database is years old and thousands of records in it, all relating to the users table. Guess I will have to use duplicate tables to hold the user info. Maybe link them somehow.
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 23713416
If you are planning to Migrate your data so you can use ASP.NET Membership provider ... then you can write Custom Membership provider which uses your old tables. It is not too complicated.. so let me know if you want some reference for that.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 1

Author Comment

by:Soluga
ID: 23720009
If you could provide some reference's that would be great.

Thanks
0
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 total points
ID: 23723595
This example Extends  Membership which usesAccess as a database:
http://www.devx.com/asp/Article/29256/0/page/1

This video uses custom Sql Tables with Membership provider:
http://www.asp.net/learn/videos/video-189.aspx

The concept is you write your own CustomMembership class that inherits from MembershipProvider class. Then override the existing methods like CreateUser,ValidateUser etc. Inside those methods you can query your DB to do the work.


0
 
LVL 1

Author Closing Comment

by:Soluga
ID: 31550117
Great thanks.
I suppose I could also change the membership stored procs to look at my users table instead of the membership users table.

Thanks
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 23746233
Soluga:
I suppose I could also change the membership stored procs to look at my users table instead of the membership users table.
No....I would suggest NOT TO modify membership stored proc as they all are highly interlinked and might messup something.
And in your case one good option is to write new stored procs that interact with your existing user tables. Then call them from your custom membership provider methods.
0
 
LVL 1

Author Comment

by:Soluga
ID: 23746511
Thanks,

I watched right through the video, and the custom membership provider is definately the way to go.

Thanks for you help
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question