This post is the first part of a two part step by step tutorial on how to migrate a SharePoint 2013 farm to SharePoint 2019.

To read the second part, click here.

Introduction

The SharePoint world is rapidly moving into the Cloud with SharePoint Online and Office 365, but some organizations are still not ready to move completely to Office 365 and SharePoint Online.

Upgrading to SharePoint 2019 that has support for a hybrid scenario can be a valid solution to allow a gradual move to the cloud.

This post is based on upgrading a SharePoint 2013 farm to SharePoint 2019 using the database attach approach but is also valid if you want to upgrade to SharePoint 2016 (to learn more about upgrading to SharePoint 2016, click here and here). This post assumes that the we will only migrate the content database(s) from the source SharePoint 2013 to SharePoint 2019 and all other SharePoint databases are created in the target SharePoint 2019 farm during its installation process.

If you want to learn more about how to install a SharePoint 2019 farm in an automated way using PowerShell, click here and here.

There is another valid migration approach to migrate from SharePoint 2013 to SharePoint 2019 by using a content migration. In this approach, the upgrade is not based in a database upgrade process but on content migration and typically a 3rd party solution is necessary to do the content migration. A few 3rd party solutions that can do the job are ShareGate, AvePoint and Metalogix.

Upgrading a SharePoint farm using the database attach approach can be a complex task and the upgrade process is composed by a series of steps:

  • Migrating Custom Developed Solutions from SharePoint 2013 to SharePoint 2019 (outside of the scope of this post)
  • Upgrade to a temporary SharePoint 2016 farm
  • Upgrade to the target SharePoint 2019 farm

IMPORTANT NOTE: In a typical upgrade process, the below steps should be performed twice if there are custom developed solutions:

  • The first time, to test the migration process and allow custom developed solutions to be properly migrated and tested by the end users
  • The second time, to perform the final migration, after all custom developed solutions are migrated and tested by the end users

This post will cover:

  • Migrating Custom Developed Solutions from SharePoint 2013 to SharePoint 2019 (details about the migration of custom solutions are outside of the scope of this post)
  • Upgrade to a temporary SharePoint 2016 farm

Migrating Custom Developed Solutions from SharePoint 2013 to SharePoint 2019

This step is outside the scope of this post but a few notes are important to mention if you have custom developed solutions that you want to migrate from SharePoint 2013 to SharePoint 2019:

  • First, you should analyze the source SharePoint 2013 farm and look for custom developed solutions and in particular for farm solutions and/or sandboxed solutions
  • If custom developed solutions are found and if you want to take the easiest migration path, you could simply upgrade your custom developed solutions to SharePoint 2019 without changing the solution architecture. This typically involves migrating server-side code from SharePoint 2013 to SharePoint 2019, possible migration of master pages and adjustments to CSS and JS files
  • Despite more difficult, if possible, you should consider migrating the existing solutions to one of the following development models:
    • SharePoint Framework: the latest and the recommended development model for modern SharePoint solutions, enabling an easier migration path to SharePoint Online and Office 365
    • SharePoint Add-Ins: this development model is still supported and can be a valid solution depending on your scenario. However, when possible. you should consider migrating solutions to the SharePoint Framework development model

Upgrade into a temporary SharePoint 2016 farm

IMPORTANT NOTES:

  • Migrating from SharePoint 2013 directly to SharePoint 2019 is not supported. To migrate from SharePoint 2013 to SharePoint 2019 we must first migrate to a temporary SharePoint 2016 farm and then migrate to SharePoint 2019
  • To to be able to migrate to SharePoint 2016 and then to SharePoint 2019, the SharePoint 2013 farm must at least have the March 2013 Public Update installed. For more details, click here

The migration is performed using the database attach upgrade method (the only supported method to upgrade from SharePoint 2013 to SharePoint 2019 using a database upgrade approach).

In the upgrade process, for both the temporary SharePoint 2016 and the target SharePoint 2019 farms, you should create an empty web application so that a valid SharePoint content database is created. To learn more on how to install a SharePoint 2019 farm, click here and here.

After having all custom developed solutions migrated to SharePoint 2019 (if there are any), you should follow the following steps:

  • SharePoint 2013 (test migration only): Export all WSPs from the SharePoint 2013 farm to file system. To export the WSP files, you can use this PowerShell script.
    SharePoint 2013 (final migration only): Go to “Manage content databases” in Central Administration, select the web application and then the option “Remove content database”. This will temporarily make the web application unavailable in the source SharePoint 2013 farm
Temporarily Remove Content Database from Source SharePoint 2013 farm
  • SharePoint 2013 Database Server (final migration only): Place the database in read-only mode to ensure the source web application is made available again and so that users cannot change content anymore during the upgrade process. This can be achieved by the following T-SQL command: ALTER DATABASE <CONTENT_DB_NAME> SET read_only
  • SharePoint 2013 Database Server: Backup of the content database(s) (in read-only mode in the final migration)
Backup the SharePoint 2013content database
  • SharePoint 2013 (final migration only): Go to “Manage content databases” in Central Administration, select the web application, then the option “Add content database” and finally select the name of the content database previously removed. This will make the web application available again in the source SharePoint 2013 farm in read-only mode, preventing users from changing any content
Add content database

Add content database (confirmation)
  • SharePoint 2016 Database Server: Copy the database backup file from the source SharePoint 2013 database server to the database server that supports the temporary SharePoint 2016 farm
  • SharePoint 2016: Go to “Manage content databases” in Central Administration, select the web application where you want to migrate to and then the option “Remove content database”. This will make the database unattached from any web application.

Remove Content Database from SharePoint 2016 farm
  • SharePoint 2016 Database Server: Restore the content database backup from the source SharePoint 2013 database server. The restore must replace the content database that was created during the SharePoint 2016 installation.
Restore the SharePoint 2013 content database in the SharePoint 2016 database server
  • SharePoint 2016: If you have custom developed farm solutions, add all the exported WSPs (without deploying them) in the temporary SharePoint 2016 farm. For each WSP, run the following command:
    • Add-SPSolution -LiteralPath $location\solution.wsp where $location is the file system location of the WSP files
  • SharePoint 2016: Execute the first of a series of PowerShell commands to associate the restored content database to the temporary SharePoint 2016 farm (in this example the web application URL is http://sp2016): Test-SPContentDatabase -Name <Content_DB_Name> -WebApplication http://sp2016
    • This PowerShell cmdlet will test the content database against the web application to verify if all customizations referenced within the content database are also installed in the farm
    • In my case, I got some warnings but none of them are upgrade blocking
Test-SPContentDatabase cmdlet result
  • SharePoint 2016: Execute the second of a series of PowerShell commands to associate the restored content database to the temporary SharePoint 2016 farm: Mount-SPContentDatabase -Name “<Content_DB_Name>” -DatabaseServer “<DBAlias>” -WebApplication “http://sp2016”
    • This PowerShell cmdlet attaches an existing content database to a web application
    • In my case, no errors or warnings were shown
Mount-SPContentDatabase cmdlet result
  • SharePoint 2016: Execute the third of a series of PowerShell commands to associate the restored content database to the temporary SharePoint 2016 farm: Test-SPSite http://sp2016
    • This PowerShell cmdlet runs a series of health checks on the site collection and its contents
    • In my case, I got a warning but once again nothing that is upgrade blocking
Test-SPSite cmdlet result
  • SharePoint 2016: Execute the fourth of a series of PowerShell commands to associate the restored content database to the temporary SharePoint 2016 farm: Repair-SPSite -identity http://sp2016
    • This PowerShell cmdlet is similar to the Test-SPSite cmdlet but fixes any issues that it finds
    • The result was identical to the Test-SPSite cmdlet: no upgrading blocking issues were found
Repair-SPSite cmdlet result
  • SharePoint 2016: Execute the fifth of a series of PowerShell commands to associate the restored content database to the temporary SharePoint 2016 farm: Upgrade-SPSite http://sp2016 -VersionUpgrade
    • This PowerShell cmdlet will upgrade the site collections associated to the web application to SharePoint 2016 mode. Before this cmdlet was executed, the site collections were still in SharePoint 2013 mode.
Upgrade-SPSite cmdlet result

To download the SharePoint 2016 migration PowerShell files, click here.

To read the second part of this two part step by step tutorial, click here.

Related Articles

If you want to convert your tenant’s root classic site into a modern SharePoint site, click here.

To learn why your business should migrate to SharePoint Online and Office 365, click here and here.

If you are a SharePoint administrator or a SharePoint developer who wants to learn more about how to install a SharePoint 2019 farm in an automated way using PowerShell, I invite you to click here and here.

If you want to learn all the steps and precautions necessary to successfully keep your SharePoint farm updated and be ready to start your move to the cloud, click here.

If you learn how to greatly speed up your SharePoint farm update process to ensure your SharePoint farm keeps updated and you stay one step closer to start your move to the cloud, click here.

If SharePoint 2019 is still not an option, you can learn more about how to install a SharePoint 2016 farm in an automated way using PowerShell, here and here.

If you want to learn how to upgrade a SharePoint 2010 farm to SharePoint 2016, click here and here.

If you are new to SharePoint and Office 365 and want to learn all about it, take a look at these learning resources.

If you are work in a large organization who is using Office 365 or thinking to move to Office 365 and is considering between a single or multiple Office 365 tenants, I invite you to read this article.

If you want to know all about the latest SharePoint and Office 365 announcements from SharePoint Conference 2019, click here and here.

If your organization is still not ready to go all in to SharePoint Online and Office 365, a hybrid scenario may be the best choice. SharePoint 2019 RTM was recently announced and if you to learn all about SharePoint 2019 and all its features, click here.

Happy SharePointing!

11 COMMENTS

  1. Great post.
    But I am wondering where to download the serials of the powershell command you mentioned in the post?

  2. Hi Miguel!
    Thanks for this well detailed right-up.

    There is one point that I don’t understand completely:
    “SharePoint 2016: If you have custom developed farm solutions, add all the exported WSPs (without deploying them) in the temporary SharePoint 2016 farm. ”

    Can we get away by not deploying the solutions? No errors while upgrading the DBs?

    • Hello Tiago,

      From my experience, yes, you can. You just need to add the solutions to the farm (using Add-SPSolution PowerShell command) but no need to deploy them in the temporary SharePoint 2016 farm.
      The upgrade process will show you some warning while you are attaching the content databases in the temporary SharePoint 2016 farm but none of these warnings should be upgrade blocking and you can then backup the content databases in the temporary farm and move them to the target SharePoint 2019 farm.

      In the SharePoint 2019 farm, you will have to deploy them (make sure the the custom developments are migrated and tested before this).

      Thanks,
      Miguel

  3. Hi Miguel ! Gare thanks for you article ! We going to migrate big Share Point 2013 portal to Share Point 2019 and we cant understand Why we must use tree stage migration Share Point 2013-Share point 2016 -Saher Point 2019 Why we cant reconnect Share Point 2016 database directly to Share Point 2019? Do we need repair it from backup ? Can we do so restore data and recoonect databse to Share Point 2016 and then rdisconnect and reconnect to Share Point 2019 ?

  4. Hi Miguel:

    If we using SharePoint Foundation 2013, do we need to upgrade to SharePoint Server 2013 before migrate to SharePoint 2016?

  5. hi bro
    thanks for your document.
    i do upgrade from your document but i have problem after upgrade .
    i see my site by when i want to change anything i give back problem such as server was unable to save the form and another error.
    i cant change in my issue list for example but i can see and change site look 🙁

LEAVE A REPLY

Please enter your comment!
Please enter your name here