views:

382

answers:

2

Has anyone tried to back up a SharePoint web application using forms based authentication (FBA) to another SharePoint server?

We are facing some issues in backup\restore of FBA based sharepoint web applications:

  1. We have a server where we have created a web application based on FBA, it has an FBA database as well.
  2. We have backed up the FBA database to the new server.
  3. We tried to backup the web application and restore it to a new server.
  4. We changed the authentication settings and made web.config entries for FBA.
  5. When accessing the site, I was able to login to the site and see all the content. But when I use this function in the object model it always returns false no matter which user I logged in to:

SPContext.Current.Web.DoesUserHavePermissions(
    SPContext.Current.Web.RoleDefinitions["Read "].BasePermissions).ToString()

Has anyone faced issues like this before?

Has anyone tried to back up an FBA based Web Application?

We did the restore to a different farm that resides in a different domain - will this have any effect?

A: 

I have managed to successfully backup and restore both the database and SharePoint web application for an FBA-enabled SharePoint application.

The steps you've listed seem correct to me but are you sure that you've completed them correctly?

Particularly step 5: you need to ensure that you've correctly changed settings for the Central Administration site and your web applications configuration settings (web.config settings and extending the application to a new zone and enabling FBA). Double check that you've configured everything as per the original application.

Another thing to check is that you've custom role definition "Admin" actually exists. I assume it does and should have been backed up/restored successfully, but it's worth checking.

One thing that I did differently was to move the content database (instead of backup/restore through Central Administration or STSADM). I don't think this should make any difference, but it worked for me.

dariom
Thanks dariom, I double checked, you see I dont have any issues in the SharePoint UI, only thing that breaks is that the Object Model code. If I login and check for the New Menu in the List and Settings Menu, it works, even I am able to add a Item to list. But when it comest to OM Code which I mentioned in the question it doent seem to work.
Kusek
Hi kusek. Strange! I don't see how the OM API code isn't working if the UI is working. Can you edit your question to show us a bit more of your code? Also, try changing SPContext.Current.Web.RoleDefinitions["Admin"] to SPContext.Current.Web.RoleDefinitions["Read"]? This should work for all users. Can you see the "Admin" role in the UI at: http://<your site URL>/_layouts/user.aspx? (make sure you use the URL to your site and not the site collection)
dariom
dariom, you will be surprised to hear this I can navigate to the url you said and there I have the SP Group which encapulates the FBA user Roles. I checked the SP Group it does have the FBA Group added there. Am just puzzled why am Not able to do it in the OM. I have edited the question as requested. not only Admin I tried for Read as well no luck it returns false. We restored the DB to the new Farm of Different domain will that cause any issue ?
Kusek
Hi kusek. I'm running out of ideas! Can you check that the accounts running the SharePoint application pools have access to the FBA database? I suspect that the account trying to access the role information doesn't have access to the FBA. Ensure that the accounts for the Central Admin, SSP and Web Application application pools have access to the FBA database in sQL Server.
dariom
Yes it has . I verified. dariom , can you do me a Favor please. You test how does the above OM code behaves in your site FBA backed up site? I tested another instance of FBA DB from Production to Staging it was same. I just wanted you to help me to confirm this. Can you Please?
Kusek
Well I narrowed down the Issue. Please refer to the below article on what was making it to break. http://skurocks.wordpress.com/2009/06/26/enable-client-integration-user-permissions-for-web-application-%e2%80%93-caution/ , Dariom thanks for your help.
Kusek
Hi kusek. I've tested out that code in my backed up and restored FBA environment and it worked. I'm not sure what might be wrong there. All I can suggest is examining the log files, installing service packs, etc. I'm running MOSS 2007 SP2 in my case, but I don't think it should matter... I'm sorry, I wish I could help more.
dariom
dariom , I got it solved , Refer my comment above (One above your Comment).
Kusek
A: 

Well I narrowed down the Issue. Please refer to the article on what was making it to break.

Kusek