Tired of broken links when someone moves a document within a site collection? Tired of nasty URL’s for a document buried deep in a doclib?
SharePoint 2010 includes a new Site Collection scoped Feature called the Document ID Service.
To enable this feature you can go the old and tired route of Site Settings -> Site Collection Features (under Site Collection Administration) or you can launch the SharePoint 2010 Management Shell and run the following:
PS C:\Users\blairb> Enable-SPFeature -id docid -url <site collection url>
Viewing the properties of a document in the document you will see your document now has a field called Document ID:
Note that for existing documents some action has to be taken on the document to cause a Document ID to be generated (like check-in/check-out.) Any new documents will have a Document ID generated on upload... Or you can go into Site Collection Administrator and force a timer job to stamp all the documents.
If you grab the link off the Document ID field you will have a URL that looks something like this:
http://<sitecollectionurl>/_layouts/DocIdRedir.aspx?ID=MFSHF5F7ZUF5-1-1
As you can see from this URL we have a new ASPX page in the layouts directory called DocIdRedir.aspx that takes a Doc ID as a querystring parameter. You can use this link to provide others with a consistent link to your documents. Even if I take the document and move it to another folder in the doclib or another doclib in the site collection the same Doc ID will still find the document.
UPDATE: A colleague asked me about Document Sets (another bad ass new feature in 2010 that lets you work with a set of files as one entity) and Document ID’s. The Document ID Service Features tags an ID on the Document Set AND on each individual file in the set. Fantastic.
I'm not having any luck with this. I turned the feature on and Document IDs are being generated. I sent the email link out, and the document is retrievable by the link. However, when I move a document from one Library to the next, the Document ID changes:
Old Document ID: SP000-8-3
New Document ID: SP000-9-3
The original email with the link containing the old Document ID can no longer find the document.
Any thoughts?
The default behavior for assigning document IDs assumes that if an item exists and already has an ID, then SharePoint Server 2010 should overwrite that ID with a document ID. This happens when an existing item in SharePoint Foundation 2010 is copied: The copy keeps the same metadata as the original, including the document ID, but it still throws the ItemAdding(SPItemEventProperties) event.
Refer this article for details on how to avoid this:
http://msdn.microsoft.com/en-us/library/ee559302(office.14).aspx
i observed one thing here.
Even when I run the appropiate timer jobs after activating the document id feature, the ids don't seem to generate immediately. The time taken is not determinstic. it varies from 20 min to 1 hour. (I have tried the Run Now option of timer jobs, still no luck). Any pointers on how to make it happen deterministically would help.
If I take backup of the whole site and restore on another server, will it preserve the Doc IDs by default?
Also can I move the documents from a particular document library residing one site to document library residing on different site, without loosing the old document ids?
Your help will be appreciated. Thanks for the wonderful article.
Referring to Jayvardhan Patil's question, I have found that a document set imported from one site to another site in another farm, their document ids could not be persistence. This is problem for content deployment. If you can offer any solution, that would be great. Thanks.
How can I move a document from one doc library to another and keep the document (I already spent a lot of time seaching for thsi "simple feature" but it seems this involves copying the document and deleting the original one, but then the copied document gets another ID)
The Doc ID does not provide persistence..it provides a known way of handling only some of the instances where the URL may change. renaming of library, renaming of folder, renaming of document.
Moving documents will always get the doc ID of the library you will move it to.
I would like to use the Document ID feature to redirect user to a InfoPath form. However, after the redirection, the form try to open in a InfoPath filler rather than in web browser. It works fine in Firefox but not in IE.I configured the document library settings to open the form in web browser. If I click the document in the form library directly , it will work and here is url
http://ybbestSiteCollection/_layouts/FormServer.aspx?XmlLocation=/TestLiability/bb-2011-02-25-Renewal-cc.xml&Source=http%3A%2F%2Fgr026015%2Dsp1%2FTestLiability%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1
If I use the document ID redirection using
http://ybbestSiteCollection/_layouts/DocIdRedir.aspx?ID=QAN7VXTX3TT5-1-1
It will redirect me to
http://ybbestSiteCollection/_layouts/FormServer.aspx?XmlLocation=/TestLiability/bb-2011-02-25-Renewal-cc.xml&DefaultItemOpen=1
Can I change the redirection logic to redirect to
http://ybbestSiteCollection/_layouts/FormServer.aspx?XmlLocation=/TestLiability/bb-2011-02-25-Renewal-cc.xml&OpenIn=Browser
im not sure if this is how it works, or a bug.
In sharepoint 2010 RTM, when a document is assigned an ID, the id appends the name of the site on the URL mylab.dev.company.local/.../DocIdRedir.aspx
Where Enterprise is the name of my site.
When i move this document to another site, the ID retains the 'Enterprise'... so if i insert the URL into the browser, it can never find the document.
In SharePoint 2010 SP1, this has been improved, when a document is assigned an ID in a document library, the name of the site is NOT appended on the url e.g mylabsp1.dev.company.local/.../DocIdRedir.aspx
But if i move the document (using manage content and structure), the document moves to a new location, but if i view the properties of the item and view its document ID, for some reason the URL appends the name of the new site in the URL e.g.
mylabsp1.dev.company.local/.../DocIdRedir.aspx
This tells me that a document can only be moved once?..
or have i got something wrong.
Hope that makes sense. Any help will be great.
Thanks
Is it possible to format the document id?
You can format document id's in PowerDMS while saving money!
No where can I find how to change the default of the Persist ID Any Help would be great
I believe you can only move the document within a site collection and still have the link work. Each site collection needs its own prefix to the document id for uniqueness across the farm. The numeric id number is appened to the end of that prefix. The number starts with 1 in each site collection.