Sdílet prostřednictvím


Copy databases to the new farm for upgrade to SharePoint Server 2016

APPLIES TO: no-img-132013 yes-img-162016 no-img-192019 no-img-seSubscription Edition no-img-sopSharePoint in Microsoft 365

When you upgrade from SharePoint Server 2013 to SharePoint Server 2016, you must use a database attach upgrade, which means that you upgrade only the content for your environment and not the configuration settings. After you have configured a new SharePoint Server 2016 environment, you can copy the content and service application databases from the SharePoint Server 2013 environment to the SharePoint Server 2016 environment. You use a backup and restore process to copy the database, and you can also choose to set the databases to read-only in the SharePoint Server 2013 environment so that users can continue to access their information, but not change it. This article contains the steps that you take to copy the databases.

Phase 2 of the upgrade process: Copy databases to the new farm

Phase 2 of the upgrade process: Copy databases to the new farm

   
123 steps This is the second phase in the process to upgrade SharePoint Server 2013 data and sites to SharePoint Server 2016. The process includes the following phases that must be completed in order:
Create the SharePoint Server 2016 farm for a database attach upgrade. Copy databases to the new farm for upgrade to SharePoint Server 2016 (this phase) Upgrade service applications to SharePoint Server 2016. Upgrade content databases to SharePoint Server 2016. For an overview of the whole process, see Overview of the upgrade process to SharePoint Server 2016.

Before you begin

Before you copy the databases, review the following information and take any recommended actions.

  • Make sure that the account that you use to copy the databases has access to SQL Server Management Studio on both the SharePoint Server 2013 and SharePoint Server 2016 environments and has access to a network location that can be accessed from both environments to store the copies of the databases.

  • Make sure that the account that you use to set the databases to read-only and read-write is a member of the db_owner fixed database role for the content databases that you want to upgrade.

  • Before you back up the databases, check for and repair all database consistency errors.

  • Make sure that the appropriate service pack or update is applied to your 2013 environment. If you are using remote blog storage (RBS) in your environment, you must be running SharePoint Server 2013 in your environment before you start the upgrade process.

Set the earlier version databases to be read-only

To maintain user access to your original environment, set the SharePoint Server 2013 databases to read-only before you back up the databases. Even if you don't want to maintain access over the long term, set the databases to read-only to make sure that you capture all the data in the backup so that you restore and upgrade the current state of the environment without allowing additional changes to be made. If the databases are set to read-only, users can continue to view content. However, they will be unable to add or change content.

Note

Don't set search databases to read-only at this point. It's best not to interrupt the search experience until you're ready to upgrade the Search service applications. You will handle these databases when you upgrade service applications (the fourth phase in the process to upgrade SharePoint Server 2013 data and sites to SharePoint Server 2016).

Important

Perform this step in the SharePoint Server 2013 environment.

To set a database to read-only by using SQL Server tools

  1. Verify that the user account that is performing this procedure is a member of the db_owner fixed database role for the databases.

  2. In SQL Server Management Studio, in Object Explorer, connect to an instance of the Database Engine, expand the server, and then expand Databases.

  3. Find the database that you want to configure to be read-only, right-click the database, and then click Properties.

  4. In the Database Properties dialog, in the Select a page section, click Options.

  5. In the details pane, under Other options, in the State section, next to Database Read-Only, click the arrow, and then select True.

You can use Transact-SQL to configure the READ_ONLY database availability option. For more information about how to use the SET clause of the ALTER DATABASE statement, see Setting Database Options.

Back up the SharePoint Server 2013 databases by using SQL Server tools

You back up the databases in SQL Server Management Studio. A backup copy of the database guarantees that you have the data in a safe state if you must enable the original farm again and is required for a database-attach upgrade. Repeat the procedure for the following databases in the SharePoint Server 2013 server farm:

  • All content databases (default database name: WSS_Content_ ID

  • The following service application databases:

Service application Default database name
Business Data Connectivity
BDC_Service_DB_ ID
Managed Metadata
Managed Metadata Service_ ID
PerformancePoint
PerformancePoint Service Application_ ID
Secure Store
Secure_Store_Service_DB_ ID

You do not have to back up the configuration or admin content databases, because you recreated these databases when you set up the SharePoint Server 2016 server farm. Upgrading the configuration or admin content databases and the Central Administration site collection is not supported.

After you complete this procedure, you will have created backups of the read-only content databases.

Important

Perform this step in the SharePoint Server 2013 environment.

To back up a database by using SQL Server tools

  1. Verify that the user account that is performing this procedure is a member of the db_owner fixed database role for the databases.

  2. In Management Studio, in Object Explorer, connect to an instance of the Database Engine, expand the server, and then expand Databases.

  3. Right-click the database that you want to back up, point to Tasks, and then click Back Up.

    The Back Up Database dialog appears.

  4. In the Source area, in the Database box, verify the database name.

  5. In the Backup type box, select Full.

  6. Under Backup component, select Database.

  7. In the Backup set area, in the Name box, either accept the backup set name that is suggested or type a different name for the backup set.

  8. In the Destination area, specify the type of backup destination by selecting Disk or Tape, and then specify a destination. To create a different destination, click Add.

  9. Click OK to start the backup process.

Repeat the previous procedure to back up all the content and appropriate service application databases that SharePoint Server 2013 uses in your environment.

Copy the backup files to the SharePoint Server 2016 environment

Copy the backup files that you created in the previous procedure from the SharePoint Server 2013 environment to the SharePoint Server 2016 environment.

Restore a backup copy of the database

After you configure the new SharePoint Server 2016 server farm, you can restore the backup copies of the databases to SQL Server. Start with one database, and then verify that the restoration has worked before you restore the other databases.

Important

Be sure to keep a copy of your original backups in reserve, just in case upgrade fails and you have to troubleshoot and try again. > Perform this step in the SharePoint Server 2016 environment.

To restore a backup copy of a database by using SQL Server tools

  1. Verify that the user account that is performing this procedure is a member of the db_owner fixed database role for the databases.

  2. After you connect to the appropriate instance of the SQL Server 2014 Database Engine, in Object Explorer, expand the server name.

  3. Right-click Databases, and then click Restore Database.

    The Restore Database dialog appears.

  4. In the Restore Database dialog, on the General page, type the name of the database to be restored in the To database list.

    Tip

    When you type the name for the restored database, you do not have to use the original name. If you want to change the database name from a name with a long GUID to a shorter, friendlier name, this is an opportunity to make that change. Be sure to also change the database and log file names in the file system (the MDF and LDF files) so that they match.

  5. In the To a point in time text box, keep the default (Most recent possible).

  6. To specify the source and location of the backup sets to restore, click From device, and then use the ellipsis ( ...) to select the backup file.

  7. In the Specify Backup dialog, in the Backup media box, be sure that File is selected.

  8. In the Backup location area, click Add.

  9. In the Locate Backup File dialog, select the file that you want to restore, click OK, and then, in the Specify Backup dialog, click OK.

  10. In the Restore Database dialog, under Select the backup sets to restore grid, select the Restore check box next to the most recent full backup.

  11. In the Restore Database dialog, on the Options page, under Restore options, select the Overwrite the existing database check box.

  12. Click OK to start the restore process.

Set the databases to read-write

You cannot upgrade a database that is set to read-only. You must set the databases back to read-write on your SharePoint Server 2016 farm before you attach and upgrade them.

Important

Perform this step in the SharePoint Server 2016 environment.

To set a database to read-write by using SQL Server tools

  1. In SQL Server Management Studio, in Object Explorer, connect to an instance of the Database Engine, expand the server, and then expand Databases.

  2. Select the database that you want to configure to be read-write, right-click the database, and then click Properties.

  3. In the Database Properties dialog, in the Select a page section, click Options.

  4. In the details pane, under Other options, in the State section, next to Database Read-Only, click the arrow, and then select False.

   
123 steps This is the second phase in the process to upgrade SharePoint Server 2013 data and sites to SharePoint Server 2016.
Next phase: Upgrade service applications to SharePoint Server 2016
For an overview of the whole process, see Overview of the upgrade process to SharePoint Server 2016.

See also

Concepts

Create the SharePoint Server 2016 farm for a database attach upgrade

Upgrade service applications to SharePoint Server 2016

Upgrade content databases to SharePoint Server 2016