HowTo upgrade a Site Collection with a custom site definition from SPS 2010 to SPS 2013 (e.g. NewsGator)

Here is a step-by-step guide on what can happen when you upgrade a site collection with a custom site definition like a NewsGator Social Sites Community from SharePoint 2010 to SharePoint 2013. This is interesting in the context of a SharePoint 2010 to SharePoint 2013 migration. The assumption is, that the content database has already been attached/ mounted and upgraded via test-spcontentdatabase and mount-spcontentdatabase.

The only thing I want to mention about the two basic powershell commands that are straight forward and you can read all about in all the MVP blogs and Technet is that you should install the custom site definition solutions before mounting and consider RBS, which will be a blocker, if you mount the database and do not also re-attach the filestreams accordingly. My advice: if you can should the risk, remove the RBS completely from your database, before upgrading.

Test-SPContentDatabase -name WSS_Content_DB -webapplication http://mywebapplication

Mount-SPContentDatabase "MyDatabase" -DatabaseServer "MySQLContentAlias" -WebApplication http://mywebapplication

Why is this article important or interesting?
The site definition contains the set of pages (default.aspx or any other *.aspx files) that may be used. This is nothing special – as a matter of fact the ootb (out-of-the-box) team site definition does the same thing. The difference is just that as a supported site definition in SharePoint 2013 you will not have the same trouble as with a custom site definition as the custom site definition is packaged in a solution that is not available with a clean installation of SharePoint 2013. That means, when you do not install the solution, mount the database and hit the root of the site collection, you will get a 404 return code, because the solution files are not deployed and hence the default.aspx does not exist.


You will however find the settings page working…

settings page

You will need to use some powershell magic, this is of course dependent on the name of your solution(s): In essence this deploys the solutions to the 14 and 15 hives of the web frontends dependent on whether they are global or web application scoped.

In my case, these were the newsgator-related solutions.

get-spsolution | ? { $_.DisplayName.startswith("newsgator.") } | % { if($_.ContainsWebApplicationResource) { install-spsolution -gacdeployment -compatibilitylevel {14,15} $_ -force -AllwebApplications} }
get-spsolution | ? { $_.DisplayName.startswith("newsgator.") } | % { if(-not $_.ContainsWebApplicationResource) { install-spsolution -gacdeployment -compatibilitylevel {14,15} $_ -force } }
get-spsolution | ? { $_.DisplayName.startswith("sharepoint.") } | % { if($_.ContainsWebApplicationResource) { install-spsolution -gacdeployment -compatibilitylevel {14,15} $_ -force -AllwebApplications} }

The site will then show up.

settings page

You have two options now. Either you click on the “Start now” link in the red notification bar to start the upgrade via UI or you do it via powershell.

If you do it via powershell make sure to use the –versionupgrade option or else it will not work.
upgrade-spsite https://all-sp13t…/sites/community3 -versionupgrade -confirm:$true

Wait for the 100.00% to be reached…

settings page

This is what your page then looks like (after upgrading). Be sure to keep in mind that I did not fully install newsgator but only installed the solutions so the error message in the web part is to be expected. If you go back to the third screen shot you will see that this is actually the same as before.

settings page

Even if the NewsGator features are turned off and the webparts removed, the solutions need to be present for the custom site definitions to work on SP2013.

After removing the solutions:

get-spsolution | ? { $_.DisplayName.startswith("newsgator.") } | % { if($_.ContainsWebApplicationResource) { uninstall-spsolution $_ -AllwebApplications -confirm:$false} }
get-spsolution | ? { $_.DisplayName.startswith("newsgator.") } | % { if(-not $_.ContainsWebApplicationResource) { uninstall-spsolution $_ -confirm:$false} }
get-spsolution | ? { $_.DisplayName.startswith("sharepoint.") } | % { if($_.ContainsWebApplicationResource) { uninstall-spsolution $_ -AllwebApplications -confirm:$false} }

this is what you see (again):

settings page

So you need to keep the solutions providing the site definition.

If you only deploy

install-spsolution -gacdeployment -compatibilitylevel {14,15} -force newsgator.blanksite.wsp
install-spsolution -gacdeployment -compatibilitylevel {14,15} -force newsgator.sitedefinitions.wsp

you will get this. So all of the dependent solutions are necessary.

settings page

So in essence this is not too complicated, but you need to make sure you put all the pieces in place before you upgrade.
I also suggest to perform a dry run to be able to solve all solutions before you upgrade your production environment. In the end it may just be as easy as Microsoft advertises, but you need to know the little pitfalls to successfully get from A to B.

3 Responses to HowTo upgrade a Site Collection with a custom site definition from SPS 2010 to SPS 2013 (e.g. NewsGator)

  1. Thijs says:

    Thanks Martin!

  2. Thanks for Sharing, same issue I’m facing but after executing the given PowerShell still the issue is not resolved. Am I missing something else?

    • sp2007hut says:

      Well it depends. The error (404) itself is rather generic, so it could also be a totally different root cause. If you are in a migration scenario and you know you are dealing with a custom template and you have deployed the solutions containing the webtemplate and they do not need to be activated first via a farm feature, then I would start by tracing with fiddler, to find out which file is sending the 404. Another good place to start is the welcome page url. The root folder of the rootweb contains the welcome page url, which you can check via powershell. You can also check the pages library – if you can reach that you have a couple of options as well. I would also check the 14-hive to make sure all the artefacts of the solution have been deployed. Of course I don’t know what custom solution you may have in your case, so the developer of the solution may be able to help as well…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: