TFS 2013 Upgrade - SharePoint 2010 to SharePoint 2013 Upgrade Errors

OK, so I'm upgrading TFS 2008 with SharePoint Foundation 2007 installation to TFS 2013 with SharePoint Foundation 2013. Naturally, you do an upgrade using an intermediary server with TFS 2012 with SharePoint 2010 install, because you cannot upgrade TFS 2008 to TFS 2013 directly (you have to upgrade to TFS 2012 first), just as you cannot upgrade SharePoint 2007 to SharePoint 2013 (you have to upgrade to SharePoint 2010 first). All goes well except for the SharePoint portion of the upgrade.

Running Test-SPContentDatabase against SharePoint content database produces a few weird errors, like:

Category : MissingFeature Error : True UpgradeBlocking : False Message : Database [WSS_Content] has reference(s) to a missing feature: Id = [00bfea71-c796-4402-9f2f-0eb9a6e71b18], Name = [Wiki Page Library], Description = [An interconnected set of easily editable web pages, which can contain text, images and web parts.], Install Location = [WebPageLibrary]. Remedy : The feature with Id 00bfea71-c796-4402-9f2f-0eb9a6e71b18 is referenced in the database [WSS_Content], but is not installed on the current farm. The missing feature may cause upgrade to fail. Please install any solution which contains the feature and restart upgrade if necessary

You would think that Wiki Page Library feature should exist in new SharePoint, and it does, but the error still shows up. Makes no sense, right. Well, if you try to go ahead and proceed with an upgrade anyways, you will see even stranger things. Upgrade completes successfully, but none of the SharePoint pages come up properly. None of the "default" SharePoint web parts come up properly. To make things worse, you cannot get to any of the system pages in SharePoint. When you try to access any system pages, like Site Settings, you get Access Denied errors (strange part is that you are denied access to built-in v4.master master page; how is that possible!). Very strange…

After a bit of digging on the web, I have found a solution. Apparently, the problem was caused by the fact that SharePoint 2013 has two modes (hives), 2010 (v14) and 2013 (v15). Apparently, by default, a new SharePoint 2013 installation mostly only installs v15 features. Using SharePoint Feature Admin Tool, we can tell that v14 features we needed were not installed. Now that we know that we can simply install missing v14 features individually using SharePoint 2013 Management Shell or we can simply install all existing features in both the v14 or v15 hives by running the following cmdlet.

Install-SPFeature -AllExistingFeatures

Second approach was easier, so I run with it. Running that cmdlet fixed all of my SharePoint problems, and that's a good thing.