How to move a site collection to a different managed path

I pulled this from the old OneNote archives the other day and figured I’d share it with anyone that might need to do the same.

The Challenge

A customer had us upgrade them to SharePoint 2010.  However, they didn’t like that their site collection was at http://go.somewhere.com/sites/department and instead wanted a dedicated managed path (explicit inclusion to “/”) of http://go.somewhere.com/department.

The Approach

First off, we did the database attach migration as we always would. Let’s get the database and content into SharePoint 2010 first and ensure it is healthy, before we start shaking things up.

Next, it was time to do the following:

  1. Create the Managed Path for the Web Application of /department (I’m not covering that here, that is discussed all over the Interweb, here’s one via a quick Google)
  2. Then perform the following:

Backup site collection

   1: stsadm -o backup -url http://go.somewhere.com/sites/department -filename c:tempdepartmentcollectionbackup

Delete site collection

   1: stsadm -o deletesite -url http://go.somewhere.com/sites/department

Restore site collection to your new managed path

   1: stsadm -o restore -url http://go.somewhere.com/department -filename c:tempdepartmentcollectionbackup

 

I’m too lazy to update this today with a PowerShell equivalent but this gets the job done.