SharePointTechnicalSupport

Troubleshooting Steps SharePoint Online Support, SharePoint Training & SharePoint Help

Access Denied Error after migrating to SharePoint 2013

Access Denied Error after migrating to SharePoint 2013

Scenario:

We were working for a client, they had many groups and we had to build a collaboration portal for all the groups. Key thing was few sites of some groups were already present in SharePoint 2010 in different standalone servers. Migration was a key thing here as the existing sites has huge data, and huge user base.

The Requirement was to build a portal /web application which will have migrated sites and new set of sites as per agreed site structure. According to the agreed architecture and design we created a new web application and started building the site hierarchy.

As part of this we followed the regular approach database detach –attach method and migrated the existing SharePoint 2010 site .Migration was successful and we were able to access the site  with the system account. Later we tried with couple of site admin accounts, to our surprise we were getting “ACCESS DENIED” with any other user id.

Background:

By default when we create a web application in SharePoint 2013, it gets created with Claims authentication. When we migrate the content DB to 2013, it recognizes the user account only in this format i:0#.w|domainusername . Though it’s an AD account it no more recognizes the DomainUserName format.

SharePoint assumes all users to be claim users and renders them so. Therefore, a normal windows user – “DomainUserName” appears as “i:0#.w|DomainUserName”. Moreover, it uses the username in this same format to check for its permissions but does not find a matching entry for the user as the database has windows users – “DomainUserName”. So, the site will give you an access denied.

Note that the System Account will work since its “DomainUserName” is never used and System Account is a keyword used by SharePoint for the application pool identity. Therefore, it remains unaffected.

Solution:

In brief the share point 2010 site which needs to be migrated should be converted to claims format and then migrate it to 2013. But a word of caution , do not directly change the SP 2010 site to claims format in a production environment as it will not allow existing windows accounts to login and existing SharePoint 2010 site will be no more operational.

Below power shell script converts classic mode site to claims mode:

Power shell script

This script converts user accounts to claims format:

Script for converting user accounts to claims format

On executing the first script (to enable claims authentication) the SharePoint Content Database is made ready for claims based authentication but the already existing site users were windows users, are not “migrated” to be understood by claims authentication.

We use the second script to “migrate” the users. MigrateUser($true) will convert all user accounts to claims format. After running this script user accounts are converted in the database to claims format, therefore, user names are read correctly by SharePoint therefore, permissions for users are associated correctly by SharePoint hence the site permissions work correctly.

Note:

By any chance if you execute these scripts directly in productions, by executing $webapp.MigrateUsers($false) will not convert user accounts to windows mode, rather it will throw an exception. Make sure you have a temporary environment built where you execute the above scripts. Also note that these scripts are running on Web Applications so they will affect all site collections in that web application

Migrate SharePoint Databases

To Migrate SharePoint DBs from SQL Server to another either same version or to a new version (2008 to 2008 or 2008 to 2012) you can follow the following steps:

  1. Stop all SharePoint and IIS Related Services.
  2. Stop IIS.
  3. Detach all related SQL Server databases.
    • Configuration database
    • Central Administration content database
    • Content databases
    • Service application databases
  4. Move all database files (.mdf, .ldf, and .ndf) to the new server.
  5. Set up same user permissions on the new SQL server.
  6. Attach your databases to the new SQL Server.
  7. Verify ports in your new SQL server.
  8. Go to your SharePoint server and create your SQL Server Alias.
  9. Start all your SharePoint services.

PowerPivot Resource File not found when creating new PowerPivot Gallery Document

While working on SharePoint 2010 to SharePoint 2013 migration, a site collection with Business Intelligence on it had quite a lot of bugs after being upgraded to 2013.. One of the bugs I found is that in a PowerPivot Gallery, whenever you want to create a new PowerPivot Gallery Document, you get this instead:

powerpivot add new document

powerpivot add new document

$Resources:PowerPivotFeatures,ReportGalleryDocumentDisplayName;

$Resources:PowerPivotFeatures,ReportGalleryDocumentDescription;

After investigating, I found out that you get the same message when you look at the PowerPivot Gallery Document content type.

PowerPivot Resource File not found when creating new PowerPivot Gallery Document

Site Content Type Information

With the info we got in those screenshots it’s pretty clear that the problem is a resource file, but why? The problem is that Microsoft, decided to rename the resource file names between SharePoint 2010 and SharePoint 2013. If you go on SharePoint 2010 in “C:Program FilesCommon FilesMicrosoft sharedWeb Server Extensions14Resources ” You will see that all the PowerPivot resource files are named “PowerPivotFeatures.resx” + language. You can view this in the image below.

powerpivot resources file location

powerpivot resources file location

However, in SharePoint 2013, when we navigate to the resource folder “C:Program FilesCommon FilesMicrosoft sharedWeb Server Extensions15Resources” , we realize that Microsoft decided to change the name of the resource file to “PowerPivot_Features.resx” As you can see an underscore is now added to the name of the file as you can see in the picture below:

PowerPivot Resource File not found when creating new PowerPivot Gallery Document

powerpivot features

Since we got our Site Collection from SharePoint 2010 to SharePoint 2013, everything still references the old resource file, which does not exist since you migrated. Unfortunately, Microsoft did not automatically fix this when you attach the Database, or when you run the “upgrade-spsite” command.

I fixed the problem by simply copying all the “PowerPivotFeatures.resx” files from SharePoint 2010 to SharePoint 2013. Since the filenames are different, you won’t have to override any SharePoint 2013 ones. So when you copy them all, your folder will look something like the screenshot below. Notice the SharePoint 2013 resource files in blue and the 2010 ones in Orange.

PowerPivot Resource File not found when creating new PowerPivot Gallery Document

powerpivot features file-location

I would do this during off hours as you may need an IISReset in order for SharePoint to pick up the new resource files.

Drop a comment if this helped!