Friday, July 7, 2017

SharePoint 2013: how to move a wildcard inclusion path site collection to root


This posting consolidates notes and references on how to move a target site collection from its wildcard inclusion path to the root of that path.  This effort is part of a larger effort to migrate a web application from wildcard inclusion topology to an explicit inclusion topology.

The procedure begins by first performing SQL Server backups of all content databases.  Next, a site collection backup is performed using the SharePoint commandlet, Backup-SPSite.  Once the target site collection has been backed up, the next task is to perform a SharePoint detach of all content databases of the target web application.  You may wish to followup this with a SQL Server detach as well, and then archiving of these databases.  Once all of the databases have been removed from the web application, the next step involves creating a new blank content database.


  1. Perform SQL Server backups of target web application content databases.  Use SQL Server Management Studio.
  2. Perform a site collection backup of the target site collection.  Use Backup-SPSite.  Example:
    Backup-SPSite "http://dev/sites/test1/" -Path E:\test1.bak -UseSqlSnapshot
  3. Perform SharePoint detach of target web application content databases. Use Central Administration (CA > Application Management > Databases > Manage content database). Or use Dismount-SPContentDatabase. Example:
    Dismount-SPContentDatabase "WSS_Content_OLD"
  4. Create new content database at target web application. Use Central Administration (CA > Application Management > Databases > Manage content database). Or use New-SPContentDatabase.  Example:
    New-SPContentDatabase -Name  "WSS_Content_NEW" -WebApplication
  5. Execute Restore-SPSite against the site collection backup.  Example:
    Restore-SPSite "http://dev/" -Path E:\test1.bak -Force -DatabaseServer "DEV" -DatabaseName "WSS_Content_NEW"
  6. Execute IISRESET
  7. Remove wildcard inclusion managed paths from web application.  Use Central Administration (CA > Application Management > Web Applications > Manage web applications > [select the target web application] > Manage > Managed Paths.
  8. Update site collection navigation.  For example, if Managed Navigation is being used, will need to update navigation term set and then re-assigned navigation to that term set.
  9. Fix any custom master page JS or CSS references.  CSS reference URLs include the entire path.  These will need to be updated



SharePoint 2013 TIP: Export All Unique Permissions from Site Collection using PowerShell

The best PowerShell script that I have found to date for inventorying a site collection's user and group permissions is one developed by Guru Karnik and published in this TechNet Wiki posting.  It runs against one site collection at a time and conveniently outputs its results to a CSV file.  The site collection URL and path to where to write the output file are entered from the command line.  Output lists the following properties:

  • SiteURL [Url to site collection or subweb]
  • SiteTitle [name of site collection or subweb]
  • ObjectType [site, list, document library]
  • ObjectUrl [relative to site collection URL]
  • ListTitle [NA if site or subweb]
  • MemberName [simple name of user or group]
  • MemberLoginName [claims-based name of user or simple group name]
  • MemberType [SPUser, SPGroup, SPGroupMember]
  • JobTitle [NA if SPUser or SPGroup, or blank if SPGroupMember]
  • Department
  • ParentGroup
  • GroupOwner [NA if type SPUser or not set, otherwise as set]
  • RoleDefinitionBindings [Full Control, Design, Read, Restricted Read, etc, etc]
Though this script was originally developed by Guru for SharePoint 2010, I have found it to successfully execute against SharePoint 2013.