SharePoint Content Database Manager


I have been quietly working on a Codeplex solution for about a month. The reason I started down this path was to give myself a goal that I could shoot towards from an application development perspective. The application that I ended up building is one that should fill a couple of gaps, primarily from an administration perspective – for on-premise SharePoint 2013 deployments. While every SharePoint Site Collection must live in a Content Database, it is sometimes not thought about up front/during the initial roll-out of a SharePoint farm. What may end up happening is your company might have 1 Content Database, with dozens/hundreds/thousands of site collections stored in it. These can grow to be very large, making maintenance a nightmare from a SQL Server perspective – but also making upgrades & migrations difficult.

There isn’t a great way out of the box to perform an inventory of what Site Collections live in a Content Database, assuming you have multiple Content Databases attached to your Web Application. Yes, PowerShell is great for this – and anyone who has read my blog or seen me present knows I love me some PowerShell – however, not all administrators do; and so I wanted to try and fill gaps for the everyday SharePoint admin. Or, the SharePoint admin who acts as an administrator of multiple systems and thus doesn’t have the time/resources to become a PowerShell wizard.

Having sort of laid the framework of why I wanted to do this – here’s some detail on what the solution contains.

  1. View All Site Collections in a Content Database
  2. Move a Site Collection to a new Content Database

Those are the main two pieces, essentially I wanted to provide a means for performing an “inventory” of your Content Database. This means being able to see all Site Collections contained within the database, but also – it means having the ability to sort by Title, Url or Storage/Disk space used. From there, and this being the primary goal, I wanted to provide a page to allow for moving a Site Collection to a new Content Database. This functionality doesn’t exist in the Central Administration UI and can only be done with PowerShell or C# code. As I said before, I love PowerShell – I didn’t really build this solution for me, I built it for the administrators who want a GUI to perform these tasks.

Here are a couple of screenshots of what it looks like in action:

First is the View Site Collections by Database page:
View Site Collections by Database

Here are instructions/details from the red numbers in the screenshot:

  1. Click to choose your Web Application
  2. Choose a Content Database, this dropdown gets populated when a Web Application is chosen.
  3. Click Get Sites after choosing a DB, this will populate the ASP.NET Gridview with all Site Collections contained in the specified database.
  4. Use the Title, URL and Storage Used fields for sorting.
  5. Click the Move Site link next to any site collection to route to the Move Site Collection page. By clicking this link, the Site GUID will be passed via query string to the Move Site page. From there, all you will need to do is specify the destination content database. See the next section for details on that page…

Not shown: the ability to click a ‘next’ arrow to move through different pages, if there are more than thirty (30) site collections in the database.

Next is the Move Site Collection page:

Move Site Collection

Here are instructions/details from the red numbers in the screenshot:

  1. Click to choose your Site Collection
  2. Choose a Content Database
  3. Click OK to invoke the Move operation.

Finally, check out the Codeplex solution and download the WSP to get started.

Please provide any feedback as you begin to use the solution!

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Facebook photo

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

Connecting to %s