RSS
 

SharePoint 2010 Document ID Service

19 Jul

I have been doing a lot of research lately on the Document ID service for a presentation and lab that I’ll be giving at the KnowledgdeLake Summit this week and through I would share some of the things I found out.

Some general setup information

  1. Active Document ID Service
    1. Site Actions –> Site Settings –> Manage Site Collection Features (Under Site Collection Administration)
  2. Configure Document ID Service
    1. Site Actions –> Site Settings –> Document ID Settings (Under Site Collection Administration)
    2. Check Assign Document IDs
    3. Enter in Document ID Prefix

     

Activating the Document ID Service adds the following fields to the Document Content Type

  • Document ID
    • This is the only field you can see inside the library
    • Unique ID assigned by the service to the document
  • Static URL
    • URL used to lookup the document
  • Persist ID
    • Used to determine if the existing Document ID should be kept or reassigned

 

Other things you should know about DocID Service

  1. Document IDs within a library are created off of the Library ID and ID of the document within the list

    When you first upload a document the Document ID URL is immediately available example: http://kldemo:81/_layouts/DocIdRedir.aspx?ID=SUMMIT-2-12

    Library ID (2) – ID (12)

  2. Events Added to each library test
  • ItemAdded
  • ItemUpdated

I could not find the ItemUpdated listed event anywhere on MSDN for Document IDs but I can only assume it is firing that event because if you upload documents before the service is enabled then edit a document after the service is turned on it will create a document id.

Testing Moving a document across libraries within a site collection

Now that I had the Document ID service setup and working I went ahead and tried moving the document within the site collection to verify the document id would remain the same.

Instead of writing code to invoke the SPFile.MoveTo method (which is documented as the only way the document will retain the current Document ID) I want to try moving the document via windows explorer like the good old days in 2007. If you need help getting this up and running on Windows 2008 I posted on that Here

Turns out if you browse to the library using UNC \\kldemo@81\Documents the SPFile.MoveTo method is not called because the Document ID get updated to a new value. However if you use the Open with Explorer option within the source and destination libraries you can right click on the file in one location and paste it into the other which does retain the original Document ID

After moving the document

The link to the document via the Document ID static URL is only as good as your last crawl!! If you have uploaded the document and a crawl has not occurred you will still be able to access the document via the link until the document has been moved. The link will become valid again once the document has been crawled.

There are two tables inside the Search Service Application PropertyStoreDB GUID database.

MSSDocResults

Table Columns

  1. DocID
  2. URL
    1. URL to the document in SharePoint
    2. This value gets updated during each crawl

MSSDocProps

Table Columns

  1. DocID – Ties back to the DocID in MSSDocResults
  2. strVal2 – Holds the DocID Static URL http://kldemo:81/_layouts/DocIdRedir.aspx?ID=SUMMIT-2-12

** NOTE:  Do not edit values directly in the SharePoint databases or the database structure.  I provided this information for that purpose only… Information

Conclusion

Document ID service is a feature that was highly requested by many of our SharePoint 2007 customers and I’m sure will be deploying it frequently going forward. However one of the reservations I have is enabling this feature in a Migration scenario or a high load time because of the ItemAdded event that will be fired for every document will significantly decrease the performance. So instead I will not enable the Document ID service until all documents have been uploaded. Then inside Central Admin I will fire off the Document ID Service timer job now instead of waiting the week (Default) for the Document ID properties to be set.

The performance degradation is an item I plan on testing here soon and will report back if I see any issues during migrations / high peak times

 

Tags: , , , ,

Leave a Reply

 

Why ask?