r p

r p

  • NA
  • 343
  • 0

More than 1 ApplicationId and RoleId for the same website in the database

Jan 21 2009 3:38 AM

Hi,
I am in the process of developing my website step by step.
I finished the first step for registration in the month of November and
I created a virtual directory called - 'NovemberSite' in my live server and also created a database called 'Novembar' 

then hosted the site. Users stared to register.

I finished the next stage in December and I deleted folder of 'NovemberSite'
and the database 'November' created another virtual directory called
'DecemberSite', then copied all the oldfiles from Novemberfolder and updated files to the DecemberSite.
I created a database called 'December' I moved the tables, stored procedures etc beginning with 'aspnet_'
to the December database from November database
using Database Publication wizard.

I did the same in Jan. I copied all the files of
DecemberSite folder and December database to JanuarySite folder and January database together with the
latest updations.
Now, recently, I got complaints from users who registered in November that they can't login to the site.
I opened the latest database -January and I could see the same role administrator is entered 3 times
(because each time when I chaged database I had to create roles.) in the aspnet_Roles.
I could see 3 different application names in the 'aspnet_Applications'(I used to modify application name
in the web.config file). I can see all the users who registered from Novermber in
aspnet_Users table
of January database. I think when I changed the folder and database,
the roleid and applicationid may have changed and this may be the reason why
my users who registered in Novermber could not login.
Now, I am planning to create a final virtual directory - MYSITE and keep all the files in that directory
and a final database called MYDB and keep always registration in that folder. But,
How can I make application id, role id etc for all users as per the latest copy of the database?
==============================================================

I am developing ONE Site with different names (NovemberSite, DecemberSite and JanuarySite).

After November, I deleted November and Uploaded DecemberSite.

I did the same in January.

Now I have 3 different ApplicationNames and ApplicationId in my database.

Same way for Administrator role itself there are 3 entries in the database.

When I open my aspnet_Applications table, I can see 3 different applications with different applicationid

For example:-

NovermberSite ApplicationId1

DecemberSite ApplicationId2

JanuarySite Application3

Again when I open my aspnet_Users table, I can find  userid for all these 3 applications

For example

ApplicationId1 UserId1

ApplicationId2 UserId2

ApplicationId3 UserId3

In my aspnet_Roles table I find

ApplicationId1 RoleId1 Administrator

ApplicationId2 RoleId2 Administrator

ApplicationId3 RoleId3 Administrator

aspnet_UsersInRoles also is in the same way

UserId1 RoleId1

UserId2 RoleId2

UserId3 RoleId3

So, my users are registered under 3 different ApplicationId and 3 different RoleId

I want to integrate all of them together. Because all these users are registered for 1 site and there should be only 1 Administrator role,

there should be only 1 ApplicationName and ApplicationId.

I don't know how to get all the Users under ONE (a single) ApplicationId and RoleId (eg. ApplicationId3, RoleId3).

Any help, or should  I create a fresh database and ask all the users to register again? That will be a big task.

Thanks