Juan Carlos

Basic PowerShell cmdlets to Upgrade Content Databases from SharePoint 2010 to SharePoint 2013

November 21st, 2012 | Author: | Filed under: CloudShare, Dev / Test, SharePoint | Tags: , , , , ,


In my previous article about upgrading from SharePoint 2010 to SharePoint 2013, I explained how to complete this task by using the Database Attach upgrade method. This technique implies the necessity to use some PowerShell cmdlets available in SharePoint 2013 to work with either content databases or service applications ones.

In this new article, I will summarize basic Powershell cmdelts we have available to upgrade SharePoint 2010 content databases to SharePoint 2013:

  • Before going into detail, you can list available cmdlets by executing the following PowerShell sentence in the SharePoint 2013 Administration Console:

Get-help *SPContentDatabase

  • After executing this sentence, you will have a list with all the cmdlets available:

  • From this list, the cmdlets we are interested in are the following: Test-SPContentDatabse, Upgrade-SPContentDatabase and Mount-SPContentDatabase.
  • Test-SPContentDatabase cmdlet allows you to identify any issue or customization you could take into account when upgrading a content database to SharePoint 2013: features installed in the SharePoint 2010 environment that should be in the SharePoint 2013 ones, language packs installed, etc. Below, you can find the general syntax for Test-SPContentDatabase.

Test-SPContentDatabase –Name <ContentDabaseName> -WebApplication <URL>

  • If the command execution detects issues in the content database, it will appear in the output window. For instance, a common issue is to have orphan objects in the content database.

  • Ugrade-SPContentDatabase cmdlet allows you to upgrade a content database that has some issues or upgrade it from one product build to another one. This command is used to only to resume a failed Upgrade. The syntax of this cmdlet is quite simple as you can see in the following script:

Upgrade-SPContentDatabase -Identity <ContentDabaseName>

  • If you execute this command in the SharePoint 2013 Administration Console, you will have to confirm that you want to start the upgrade process in the related database. If there are no problems, a warning message will be shown indicating that the database doesn’t need to be upgraded.
  • Finally, you have to execute the Mount-SPContentDatabase cmdlet in order to add a content database to an existing web application. Please note that only once you have fixed any existing problem found with the content database,  should you execute this command.  You are then ready to add to an existing web application. Mount-SPContentDatabase syntax is quite simple as you can see below:

Mount-SPContentDatabase -Name <ContentDatabaseName> -WebApplication <URL >

And that’s all there is to know about upgrading from basic PowerShell cmdlets to SharePoint 2010 content databases to a CloudShare SharePoint.

Happy CloudSharing!

About the author:
With more than 10 years of experience in the ICT sector, what best define me is the interest and knowledge of new technologies as a natural way for attending and solving customer problems and needs. My career in the TIC sector, and particularly in the .NET platform started in 2003, just after finishing my studies at the university, in the global worldwide consultancy company Accenture. There, I had the opportunity of working during 3 years in big national and international projects performing different task and roles: development of VB.NET applications, application test and deployment, management of small development teams and so on. In May 2006 I left Accenture and started a new adventure at the Microsoft Innovation Center in Cantabria (CIIN) as a Solutions Architect. In this new stage, I had the opportunity of knowing deeply a variety of Microsoft technologies such as SharePoint, Office 365, Windows Azure, Visual Studio, SQL Server Reporting Services, BizTalk, LINQ, Entity Framework, etc. At the CIIN I haved performed evangelism activities just around these technologies, and I have had the honor of belonging to one of the more specialized organizations in SharePoint in Spain. In October 2013 I joined LKS where I perform a Consultant and Solutions Architect role skilled in SharePoint and Office 365 platforms. My daily work in LKS is focused on providing SharePoint & Office 365 advice and consultancy, specialized training and evangelism in the different projects and LKS customers where I’m involved.