Every time a change is made to a repository record, the repository item history table is updated with the previous values for the record. These previous values can be viewed by examining the history for the record. Erroneous changes can be rolled back from a previous version of that record, provided the history record is available. If a large number of records were erroneously changed, rolling back each record through the UI is tedious and error-prone (by skipping a record, or selecting the wrong previous version). There is no native way in the UI to perform mass-rollbacks of changes.
The stored procedure EW_ExtractMassRollbackData was previously created to facilitate performing mass-rollbacks of changes. When executed, it generates an import file of the records to be rolled back along with their values that were prior to the designated time the unintended change was made. This file can then be imported into the same repository to effectively roll back the records, restoring them to the previous state. This stored procedure is covered in detail in EnterWorks Tech Talk: "ETT 164 - Performing a Mass-Rollback Using SQL". One of the side-effects of rolling back records using this stored procedure is that the Data Last Updated state field will be updated with the date of restoration and any VTL and Change Notification Processing will be applied to the records as they are imported (the Change Notification can be disabled for the import). With larger repositories, it may be necessary to manually split the generated file into smaller files with fewer columns and submit multiple imports.
A new stored procedure EW_Repository_Mass_Rollback rolls back the designated records directly without creating a file that needs to be imported and possibly split into multiple files. It also restores the Data Last Updated and Data Last Updated By fields to reflect what was set prior to the unintended update that needs to be rolled back.
This session provides detail on this stored procedure and how to use it to perform a rollback of mass-changes to a repository.
Link: https://preciselyu.precisely.com/enterworks-ett-179-performing-a-direct-mass-rollback-of-enterworks-repository-records-using-sql/2204218
------------------------------
Brian Zupke
*Precisely Software Inc.
------------------------------