This article describes the author's problems with using Import-spmetadatawebservicepartitiondata in a SharePoint farm environment that uses SQL Server high availability. Hope to be of help to everyone.
I recently exported metadata using export-spmetadatawebservicepartitiondata from the development environment, Then use Import-spmetadatawebservicepartitiondata to import the metadata backup file into SharePoint 2013 using SQL Server High Availability In the test environment of the farm environment, specifically exported, import commands refer to migrating managed Metadata service between SharePoint 2013/2010 Farm.
However, when you import using Import-spmetadatawebservicepartitiondata, you encounter the following error
Import-spmetadatawebservicepartitiondata:cannot bulk Load because the file
"\\...\script\ecmgroup.dat" could
Not being opened. Operating System error Code 5 (Access is denied.).
+ Import-spmetadatawebservicepartitiondata $svc. Id-serviceproxy $proxyName
-path ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ Categoryinfo:invaliddata: (microsoft.share...cepartitiondata:
Spcmdletimportm...cepartitiondata) [Import-spmetadatawebservicepartitionda
TA], faultexception ' 1
+ FULLYQUALIFIEDERRORID:MICROSOFT.SHAREPOINT.TAXONOMY.CMDLET.SPCMDLETIMP
Ortmetadatawebservicepartitiondata
The author Google a circle, found that the explanation on the internet is nothing less than:
1. To use the network path \\...\script\ecmgroup.dat
2. To place the shared directory on a SQL Server server (on DB1)
3. To give SQL Server service permission to read and write to a shared directory
These authors have done, or package the same mistake.
The essence of Import-spmetadatawebservicepartitiondata is to use SQL bulk to bulk import data, so I use the following statements to test:
Use [service_db]bulk Insert [dbo]. [Table_1]from "\\...\script\ecmgroup.dat"
The error is found when connecting to SQL HAG cluster:
MSG 4861, Level A, State 1, line 2
Cannot bulk load because the file "\\...\script\ecmgroup.dat" could not being opened. Operating System error Code 5 (Access is denied.).
So I set the shared directory on the DB2, and then run the above command, successful
So I also import-spmetadatawebservicepartitiondata the parameters of the diversion DB2 on the shared directory, sure enough success.
It was later discovered that this was because DB2 was the master node of the entire Hag cluster.