Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Update version Sequence
    • Sign In

    • State Not Answered
    • Replies 1 reply
    • Subscribers 65 subscribers
    • Views 104 views
    • Users 0 members are here
    • powershellscripting
    • ProjectWise

    Update version Sequence

    Evan Hala
    Offline Evan Hala 3 months ago

    Is there a way to update the sequence of versions when they are scrambled? The large set of data I have has this problem so a batch fix through PowerShell I would think would be a better solution versus deleting and reimporting the documents in the correct version sequence. In the example attached version 006 is shown as the oldest version even though 003, 004, 005 are present in the stack.

    Looking, I seen VersionSequence was available, but I'm not getting the results to change the sequence.

    New-pwlogin -usegui

    $InputDocuments = Import-Csv "ENTER FILE PATH.csv"

    ForEach($A in $InputDocuments)
    {
    $doc = Get-PWDocumentsByGUIDs -DocumentGUIDs $A.GUID
    $doc.VersionSequence = $A.Sequence
    $doc | Update-PWDocumentProperties
    }

    Undo-PWLogin

    Thanks,

    • Sign in to reply
    • Cancel

    Top Replies

    • MWBSI
      MWBSI Mon, Jun 26 2023 11:12 AM +1
      Looking at the help for Update-PWDocumentProperties, I see that only the version string, not the version sequence is available to be changed. We consider the capability of changing the version sequence…
    Parents
    • MWBSI
      0 MWBSI Mon, Jun 26 2023 11:12 AM

      Looking at the help for Update-PWDocumentProperties, I see that only the version string, not the version sequence is available to be changed.  We consider the capability of changing the version sequence too much of a risk for data corruption.   

      That said,Export-PWDocumentsToArchive will export the version sequence to an SQLite database.  You could modify VersionSequence column of the General_Documents_Table as appropriate, then re-import the documents using Import-PWDocumentsFromArchive.  You can Google SQLite to find the link to download SQLite Studio.  This will allow you to edit the exported archive database.

      If you choose the above approach, please use caution, testing it out first on sample documents.  You would be doing it at your own risk.  Look at the help for the import / export to archive cmdlets first.   

      Mark Weisman | Bentley Systems

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • MWBSI
      0 MWBSI Mon, Jun 26 2023 11:12 AM

      Looking at the help for Update-PWDocumentProperties, I see that only the version string, not the version sequence is available to be changed.  We consider the capability of changing the version sequence too much of a risk for data corruption.   

      That said,Export-PWDocumentsToArchive will export the version sequence to an SQLite database.  You could modify VersionSequence column of the General_Documents_Table as appropriate, then re-import the documents using Import-PWDocumentsFromArchive.  You can Google SQLite to find the link to download SQLite Studio.  This will allow you to edit the exported archive database.

      If you choose the above approach, please use caution, testing it out first on sample documents.  You would be doing it at your own risk.  Look at the help for the import / export to archive cmdlets first.   

      Mark Weisman | Bentley Systems

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    No Data

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies