Monday, June 1, 2015

SharePoint 2013: [MissingSetupFile] File...is referenced [...] times in the database but is not installed on the current farm

Print this posting
Problem

You are performing a database attach upgrade from some previous version of SharePoint to version 2013.  The upgrade fails or completes with warnings.  Checking the upgrade error log file, you see some warnings like this one:
[powershell] [SPContentDatabaseSequence] [WARNING] [time/date]: File [Features\Bamboo.UserAccount.Setup.WebPart\WebParts\CreateUserWebpart.dwp] is referenced [1] times in the database [content name], but is not installed on the current farm. Please install any feature/solution which contains this file.
Running the Missing server side dependencies rule, you see something similar:
[MissingSetupFile] File [Features\Bamboo.UserAccount.Setup.WebPart\WebParts\CreateUserWebpart.dwp] is referenced [1] times in the database [CS_Content], but is not installed on the current farm.
These messages indicate a problem, but not the location of the problem.  The locations of these missing setup file references are needed in order to remove them.  The solution is to look directly in the database itself for this information; specifically, the AllDocs table.

Solution
  1. In the warning or error messages, note down some unique part of the file path.  For example, in the messages above, "Bamboo" is unique.
  2. Log into the farm database server.
  3. Launch SSMS
  4. In Object Explorer, expand: [database server] > Databases > [content database] > Tables > dbo.AllDocs.
  5. Right-click the database, and then choose New Query.
  6. Enter the following
    USE [content database name]
    SELECT * FROM AllDocs
    WHERE SetupPath LIKE '%Bamboo%'
    
    This returns all instances of the setup file and their usage.
  7. Among the returned results, look in the DirName column for each result.  This column provides the location that you need.
References
  • [MissingWebPart] WebPart class: You'll see this in the ULS upgrade error log file.  An ID will be associated with this.  Note down this ID.  Then open up the content database in SSMS, drill down to the WebParts table.  WebPart class IDs can be found in the tp_WebPartTypeId column of the WebParts table.

No comments: