September 2013 - Posts

With SharePoint 2013, Upgrade Evaluation Site Collections can come in quite handy.  They allow you to test what a site will look like once upgraded without affecting the site you just attached.  If there are issues, you can just correct them in the source 2010 version site, and run the upgrade process again.  You can request an upgrade evaluation site collection, by clicking Try a Demo Upgrade after clicking on the bar at the top of your site that says Explore all that SharePoint 2013 has to offer.

RequestUpgradeEvaluationSiteCollectionButton

If you have a rather large site collection though (greater than 100 GB), you will find that you get an error when you click the button to upgrade.

Cannot create upgrade evaluation site for site collection http://server/sitecollection because it is larger than 100 GB.  The request must be made by a farm administrator.

RequestUpgradeEvaluationSiteCollectionTooLargeError

Wait a minute though!  I am a farm administrator!  How odd? What to do?  In order to get around this, I decided to go with PowerShell.  In my talk SPC195 from SPC12 last year, I touched on how to request an upgrade evaluation site collection using PowerShell.  I put those slides to work and executed the command below.

Request-SPUpgradeEvaluationSite http://server/sitecollection

Running this cmdlet will return nothing if successful.  It doesn’t actually start the upgrade evaluation site collection process though.  By default, that executes using the Create Upgrade Evaluation Site Collections job nightly around 1:00 am.  You can make it run now though by finding the appropriate job definition for the web application in question and running it now.  Next, all you have to do is wait.  After all, your site collection is fairly large so that means you are going to be waiting a while.

In SharePoint 2013, host-named site collections (HNSC) are all the rage.  SharePoint Online has been using them heavily for some time now and in general, they are the preferred method for creating site collections now with SharePoint 2013.  If you aren’t familiar with what I mean by host-named site collections, let me give you an example.  Host-named site collections give you the ability to provide completely different URLs for a site collection regardless of the web application URL hosting it.  For example, you might have a web application URL named http://sharepoint.mycompany.com and under it you have a collaboration site with a URL of http://collaborate.mycompany.com and an Intranet site named http://intranet.mycompany.com.  This allows you to host multiple types of SharePoint sites together on a single web application which ultimately reduces the amount of resources your server farm needs for application pools.

Host-named site collections are great, but what if we want to append a path-based site collection onto our HNSC?  The TechNet article does a good job explaining HNSC but when I read it, it wasn’t clear to me if you could combine the two. Now, this is interesting but what if your HR department wants their own site collection under http://collaborate.mycompany.com?  You could always give them an HNSC as well such as http://hr.mycompany.com.  However, if you don’t want that and you really want the URL to be located under your other URL such as http://collaborate.mycompany.com/hr, this can be done with some simple PowerShell commands.  If you have worked with HNSC before, you know PowerShell is our only option if we want to use them as there is not any place in Central Administration to set them up.

Just like any site collection, you have to create a managed path for the URL you want.  We do this using New-SPManagedPath.  We can add explicit or wildcard inclusions just like you can for path-based site collections.  Wildcard is the default, if you want explicit, include the –explicit parameter.  We also need to add the –HostHeader parameter to indicate this is used with host-named site collections.  Here’s an example, where I created the HR explicit path from our example above.

New-SPManagedPath "MyPath" -HostHeader -Explicit

HNSCPowerShellAddManagedPath

This technically makes this managed path available on any host-named site collection.  If you want to see what managed paths have been created for host-named site collections, use Get-SPManagedPath with the –HostHeader command.

Get-SPManagedPath -HostHeader

HNSCPowerShellGetManagedPath

Now, we need to create the site collection using New-SPSite.  It takes a few parameters but the important ones for this scenario is the URL we want for the new site collection and then –HostHeaderWebApplication to specify which web application hosts the new site collection.

New-SPSite http://wingtip.com/mypath -HostHeaderWebApplication http://webapplicationurl -Name "Site Name" -OwnerAlias domain\user -Template STS#0

HNSCPowerShellNewSiteCollection

When the command is done, you will have a new site collection at the URL you specified.  Give it a try for yourself.

I’m excited to be giving two sessions at Dev Connections in Las Vegas next month.  I haven’t been to this conference since 2004 I believe so I am excited to be returning as a speaker.  I’ve got two session on Thursday (10/3).  My first session is with the one and only Fabian Williams (@fabianwilliams) where we’ll be talking about exposing data from Azure in SharePoint and searching on it.  Then I’ll have an into talk about getting started with SharePoint Online development.  If you are going to be in town for the conference, I’d love to see you there!

Here is my session information:

If you are thinking about going, you can register here.

Follow me on twitter: @coreyroth