I have read the documentation on how to purge old items. It describes using the Remove-TcmItemsOldVersions
PowerShell script to do this. I am running into a number of issues with the script
- We have about 300 publications, each with thousands of folders. This requires calling the script for the root folder of every publication
- When calling this script with the recursive parameter set to true, the script consistently times out.
- There seems to be no way to filter on item types (i.e. Components, Schemas, Multimedia Components and Templates etc
We would like to run this script daily, but at this point we can’t execute the script on a single root folder without it timing out. How do other people handle this challenge?
My thought is to write a custom C# script which runs daily that recursively iterates through the Publications and their folders, and calls the Core Services PurgeOldVersions(purgeIntructions) method for each folder and its children separately. I feel like this is inefficient, but the only way to get manageable transaction sizes which won’t time out. Does this seem like a sensible approach? If I do use this approach, is there a way to filter on ItemTypes? Or would I need to get list of each folder (with a filter) and then review the history of each item in the list?