Import errors

You may receive the error, Import-SPMetadataWebServicePartitionData. This error indicates that you do not have permission to use the bulk load statement when attempting to import the metadata.

The bulk load error

This error happens if the service application pool used by the Managed Metadata service does not have the bulkadmin SQL Server database permission.

The steps detailed in this section are from http://www.lucacostante.com/item/5-import-spmetadatawebservicepartitiondata-you-do-not-have-permission-to-use-the-bulk-load-statement.html

To determine the account name and database name, run the following commands in the PowerShell window:

$mmsApplication.ApplicationPool

$mmsApplication.Database.Name

The service account pool and metadata service database name gets displayed.

For example:

Getting the service application pool service account and metadata database name

In this example, the service application pool account is BONZAI\sp-ap-service and the database name is BONZAI_Service_MetaData. Now, do the following:

  1. Open SQL Server management Studio and grant the bulkadmin server role for the service account.
  2. Navigate to Security> Server Roles >bulkadmin.
  3. Add the service application application pool service account.

Adding the service account to the bulkadmin role

Return to the PowerShell window on the SharePoint server and re-run the Import-SPMetadataWebServicePartitionData cmdlet.

For example:

Successfully importing after granting the service account the bulkadmin role

In SharePoint farms where SQL Server is dedicated to its own machines, the cabinet must be put on a local drive on the SQL Server and shared. If not, Import-SPMetadataWebServicePartitionData generates an Access Denied error.