Import User Accounts into DNN

Recently I worked on creating a portal using DNN5.6. This portal was going to replace an existing site that was built with every early version of DNN that used .Net1.1. After completing the site came the time to import all the users from existing site to new site. The latest site used ASP.Net SQL Membership provider. User management tables in old DNN are very different from how DNN uses ASP.Net membership provider in latest version of DNN. To import DNN users from old version, I had to do some research on new database tables involved. In this post I will try to provide some details on all the tables involved in user account managements in DNN that uses SqlMembershipProvider.

MemberShipProvider Table

DNN uses following two tables to store bare minimum login information for a user.

  • aspnet_Users
  • aspnet_Membership

SqlMembership provider stores user's password in aspnet_Membership table where as user ID as primary key is stored in aspnet_Users table. These two tables are used to perform first stage of authentication for a DNN user.

DNN User Tables

DNN maps SqlMembershipProvider user accounts to DNN user accounts in following tables.

  • dnn_Users
  • dnn_UserPortals
  • dnn_UserRoles

Every membership user account has an entry in dnn_Users table. DNN uses a single sign-on for a user for all portals. An entry in dnn_UserPortals determine user's access to individual portals. By default a user is not assigned any roles. If you need to assign certain role(s) to user accounts, then look in dnn_Roles tables and then appropriate entries need to be created in dnn_UserRoles table.

You do not have to manually create any entries in these tables. I would highly recommend using stored procedures created by DNN to take care of all the database tasks involved in creating user account(s). Here is simple procedure to follow.

  • Use Membership object to create user's account in membership provider. This can be accomplsihed by Membership.CreateUser method.
  • Now call dnn_AddUser stored procedure to create DNN user account mapping to membership provider user.
  • If you need to assign role(s) to user account, then call dnn_AddRole stored procedure for each user.

This should get you started with importing user accounts into DNN.

comments powered by Disqus

Search

Social

Weather

23.8 °C / 74.9 °F

weather conditions Clear

Monthly Posts

Blog Tags