Where are documents (and their metadata) stored in content database?

Patrik 1 Reputation point
2020-12-06T00:36:03.187+00:00

I am trying to migrate a SharePoint 2013 to SharePoint Online. The 2013 site has numerous document libraries which went all fine to migrate using the SharePoint Migration Tool. Except one library. I end up getting Error 0x01310007 - "Failed to Read the file:Could not retrieve file's metadata". For each of the 500+ documents.

I have all the necessary user rights to access the files and the document library. I was able to successfully migrate the 30+ other document libraries with the same account. I tried different versions of SPMT. I tried most things with no luck.

Googling the error code doesn't make me wiser. It appears to be a pretty generic error message that could mean anything. I found a handful of forums where other people ran into the same issue but no real solution to it.

I do think I might have a clue what may be causing the problem in my case. I did not install or configure the original SharePoint 2013 server. But I discovered that the SharePoint is running a scheduled task. A homemade C# code that reads data from the company's 3rd party customer database and then updates metadata in the problem document library. For example, when a customer is marked "obsolete" in the 3rd party database - the corresponding documents in SP are also marked as obsolete. So the staff can easily tell in SharePoint which documents are current and which are obsolete.

The C# executable was coded some 7+ years ago by an IT company that no longer exist. I don't have any means of tracking down the actual person who once made the code. And I do not have the source code. Just the executable. There's no reasonable way to tell exactly what the code really do and how it access the document metadata. All I know is that if you do change a customer to "obsolete" in the 3rd party database, documents in SP for the same customer will also be updated with "obsolete" in a status field soon enough.

I suspect the code makes changes to the metadata in a way that SPMT fails to make sense of it when I try to migrate. I wouldn't know how or by what syntax. Maybe the C# code is adding a colon or comma too much in some metadata field. Maybe it's replacing SharePoints own metadata.

Is there a way to see the metadata associated with each file in a Document Library in the SQL Server content database? I am not really sure what I expect to find or even what I'm asking. I just imagine I could compare metadata for files in libraries I was able to migrate without problem with metadata for files in the problem library.

(I am absolutely not looking to migrate the mysterious C# executable to work with SharePoint Online. I just want to migrate the document library that seemingly have strange metadata)

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. trevorseward 11,711 Reputation points
    2020-12-06T00:43:16.073+00:00

    Accessing SharePoint databases directly is generally not supported but would likely not offer you any further details to the issue. You should see if there are any pointers in the ULS log on SharePoint as to why you're seeing the error.

    You can use tools like ILSpy or .NET Reflector to decompile the C# binary to see what it is doing.

    If you don't need to preserve the metadata, you could always download the files to the local machine and use SPMT to migrate that.


  2. Joe Thomas 1 Reputation point
    2021-04-29T12:01:20.39+00:00

    @Patrik - Similar issue here. We have three libraries with scheduled tasks using a 3rd party .net application. Where you able to resolve yours?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.