Hi, I have a very old DNN 4.7 website. I have a question - is it possible somehow to transfer users from DNN 4.7 to DNN 9 or 9.1?
I know how to create users programmatically, but I need to preserve User Id and credentials.
Thank you.
AFAIK. there's no way to do this while keeping the UserIds as these are created when the user is created. You could however search for tables that store the UserId and change that value to the new userid maybe?
Thank you for reply. Is there any option to upgrade DNN 4.7 to DNN 9?
Thanks
Hi Alex
Not sure if this helps, and I cannot remember the original version of DNN I started with but it was a system I started in 2016/17.
I have system, for volunteer drivers, where users have a login to DNN but their Roles in the system mean that UserID 1 may be a Coordinator and UserID 2 may be a Driver so DNN UserID = 2 links to DriverID = 1
What I'm interested in is you mention you know programmatically how to add new users. Now originally I had a DNN module that Bulk added users from a CSV file, but since DNN changed the development environment from VB (?) to C (#) that module is no longer supported.
Two questions
1. Have you developed a similar module
2. Do you know the SQL code that adds users
All the best
Dave
Hi, please use this code as an example
Public Function AddUser() As Long
Dim oUserInfo As New UserInfo
With oUserInfo .PortalID = 0 .Membership.Username = NickName .Username = NickName .Profile.FirstName = FirstName .FirstName = FirstName .Profile.LastName = LastName .LastName = LastName .Membership.Email = Email .Email = Email .Membership.Approved = True .AffiliateID = Null.NullInteger
If Me.IsRandomPassword = False Then .Membership.Password = Password .Membership.PasswordQuestion = "aaa" .Membership.PasswordAnswer = "bbb" Else Password = UserController.GeneratePassword .Membership.Password = Password End If .Profile.ProfileProperties("Facility").PropertyValue = Facility .Profile.ProfileProperties("Street").PropertyValue = Me.Address .Profile.ProfileProperties("Unit").PropertyValue = Me.Apartment .Profile.ProfileProperties("City").PropertyValue = Me.City .Profile.ProfileProperties("Region").PropertyValue = Me.State .Profile.ProfileProperties("PostalCode").PropertyValue = Me.Zip .Profile.ProfileProperties("Zip4").PropertyValue = Me.Zip4 .Profile.ProfileProperties("Telephone").PropertyValue = Me.HomePhone .Profile.ProfileProperties("WorkPhone").PropertyValue = Me.WorkPhone .Profile.ProfileProperties("Cell").PropertyValue = Me.CellPhone .Profile.ProfileProperties("DOB").PropertyValue = Me.DOB .Profile.ProfileProperties("SSN").PropertyValue = Me.SSN .Profile.ProfileProperties("Sex").PropertyValue = Me.Sex .Profile.ProfileProperties("LanguagePreferences").PropertyValue = Me.LanguagePreference .Profile.ProfileProperties("Language").PropertyValue = Me.Language .Profile.ProfileProperties("Supervisor").PropertyValue = Supervisor .Profile.ProfileProperties("AvailableDepartments").PropertyValue = AvailableDepartments .Profile.ProfileProperties("Extension").PropertyValue = Me.Extension .DisplayName = oUserInfo.FirstName & " " & oUserInfo.LastName End With
Dim createStatus As UserCreateStatus = UserController.CreateUser(oUserInfo)
If createStatus = UserCreateStatus.Success Then Dim MyID As Long = oUserInfo.UserID Dim Role As New RoleInfo
Role = Me.RoleByName("Registered Users") Dim PortalSettings As New PortalSettings RoleController.AddUserRole(oUserInfo, Role, PortalSettings, Null.NullDate, Null.NullDate, MyID, False)
If CityAdmin Then Role = Me.RoleByName("City Administrators") RoleController.AddUserRole(oUserInfo, Role, PortalSettings, Null.NullDate, Null.NullDate, MyID, False) ElseIf Inspector Then Role = Me.RoleByName("Audit Inspector") RoleController.AddUserRole(oUserInfo, Role, PortalSettings, EffectiveDate, ExpiryDate, MyID, False) Else Dim RoleNames() As String = RoleName.Split(",") For r As Integer = 0 To RoleNames.Length - 1 Role = Me.RoleByName(RoleNames(r)) RoleController.AddUserRole(oUserInfo, Role, PortalSettings, Null.NullDate, Null.NullDate, MyID, False) Next End If Return MyID End If
End Function
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.