locked
Missing Minor Versions!! RRS feed

  • Question

  • Hi guys,

    I am experiencing a very odd issue and hope you can help. I have a document in my SharePoint document library which has 27 minor versions (0.1...0.27) and 1 major publish version (1.0).

    Using contentDB attached upgrade to SharePoint 2010 I migrated my documents from SP 2007. Everything works perfect at this stage.

    If I connect to this library using: Local Connection (SharePoint Object Model) I can only see the major version not all minors one. But if I go to SharePoint UI for same documents I can see all versions. This is very odd as this only happens for some of my documents (especially with a lot of minor versions) and other document looks fine. I wonder if there is any implications for this...

    I also had another requirement to update the content of this document without changing to it their last published version number. For this I used the word automation with PowerShell scripts as below:

    First unpublish document as:

    $Item.File.UnPublish(" ")
    $Item.File.Update();

    make a changes to the content and then

     $document.save()
     $document.close([Ref]$donotsave)

     Then publish it again after the changes:

     $Item.File.Publish("Published")
      $Item.File.Approve("Approved")
      $Item.File.Update();

     and finally close word automation document:

     $document.close([Ref]$donotsave)

    I appreciated this might not be the best approach but it did work for most of my items. However I have just found that some documents which they had loads of minor version after run the above scripts their minor versions have been disappeared. Now If I check the version history using SharePoint UI I can only see the the last major number or only one last minor version.

    I was wondering whether it would be possible that this behavior occurred due to the scripts. Is anyone seen this issue before by any chance?.

    My document library setting is as follows:

    Content approval = Yes

    Document Version History = Create major and minor (draft) versions

    Draft Item security = Only users who can edit items

    Require Check-out = No

    Any advice greatly appreciated.

    Wednesday, May 29, 2013 2:07 PM

All replies

  • I think I know what was missing!

    In my PS scripts I did not use  $Item.SystemUpdate($false) I wonder that was the reason after running the scripts all my minor versions gone and only major one left. Is anyone experience this before?

    Thursday, May 30, 2013 10:15 AM