The PTC Community is on temporary read only status in preparation for moving our community to a new platform. Learn more here
Version: Windchill 13.0
Use Case: I want to delete lakhs of EPMDocuments in bulk with status NEW and in users workspaces. Is there a utility to do so? If yes, please share the details related. Also, if we want to consider deleting the New objects from database, I want to understand what all tables contain this new object details and what tables need to be considered while cleanup.
Description:
I want to delete lakhs of EPMDocuments in bulk with status NEW and in users workspaces. Is there a utility to do so? If yes, please share the details related. Also, if we want to consider deleting the New objects from database, I want to understand what all tables contain this new object details and what tables need to be considered while cleanup.
Solved! Go to Solution.
Hi @HM_12234470,
To my knowledge, there is no OOTB utility available to delete the new status EPMDocuments.
A custom utility would need to be developed to delete all the objects.
Directly deleting records from the database using SQL is not advisable, as it may result in data integrity issues or unintended system behavior.
Hi @HM_12234470,
To my knowledge, there is no OOTB utility available to delete the new status EPMDocuments.
A custom utility would need to be developed to delete all the objects.
Directly deleting records from the database using SQL is not advisable, as it may result in data integrity issues or unintended system behavior.
Yes. lakhs of objects. We have the document number details
Hi @HM_12234470,
The following article will help you with the relevant API and also highlights the important aspects to consider before deleting an EPMDocument.
https://www.ptc.com/en/support/article/CS407491?source=search
Thank you! Will try this out. Do you think deleting workspaces is better instead of deleting the objects? I feel deleting objects would be better way.
I have attempted to delete the workspace manually, which contains the new status objects, and did not encounter any issues.
The new status object has been removed from the Windchill database.
Based on this, deleting the workspace appears to be a viable option.
However, this should be confirmed with the users before proceeding, as they may lose any data that has not been checked in.
Either approach should be acceptable, provided user confirmation is obtained.
I agree that deleting the workspace is the best option. Users can always backup data our of a workspace before deleting if there is a mix of things to keep and things to be deleted. Deleting at the DB or API level can leave broken links and cause errors later if you do not know what you are doing. Curious is this a single user transgression or many years of bad practices? You might find that your lakhs of EPMDocuments (hundreds of thousands, love learning words from other languages), might reside in 50 workspaces.
Hi @avillanueva ,
Totally agree, deleting the workspace would be the best option. The challenge, however, is that there are hundreds of thousands of objects scattered across multiple workspaces created by different users over the past 10 to 15 years. Some of the workspaces are still active and active users are still utilizing those workspaces.
Thanks
Hari
for delete
wt.fc.PersistenceHelper.manager.delete(Persistable);
Just to clarify the scenario. Why are you trying to delete thousands of new EPMDocuments? Are these disconnected/deleted user workspaces, active user workspaces, or a mix of both? Is it just new or new and checked out?
PTC produced a utility to do this per user account back in 9.1.
https://www.ptc.com/en/support/article/CS40939
It was developed for scheduled clean up of the publishing account's workspaces. It also proved handy in cleaning up disconnected participants.
Maybe you can get it from PTC Tech Supt?
https://www.ptc.com/en/support/article/CS26108
The utility undid checkout and deleted new objects. It purged the workspaces and then deleted them.
You can at least separate deleted from active user accounts and use this to cleanup all the deleted users in minutes.
Another option is to define a search that returns your new objects of new object per user account. Provide a list of semicolon separated usernames and it returns a list of new objects in all their workspaces.
Hi @mmeadows-3 ,
Mix of both. We there are objects in NEW status from many years. This is only for New objects.
Manually deleting/purging from the UI is a tedious task. So, we are checking for a utility.
The articles you shared might not be helpful because for one of the articles - Manually deleting/purging from the UI is a tedious task. So, we are checking for a utility.
For another article - We are not mainly preferring to delete the whole workspace because the active users are still using the workspaces. Also, there might be a chance that the disconnected users might again come back because the access is provided on organization basis and the users might switch organizations internally and based on that users might be provided access again to Windchill and they might want to utilize the data again from their old workspaces
If these are inactive users, delete the users and take the steps to delete their personal cabinets. This will whack the workspaces. For active users, they need to do better. I would immediately roll out training to them to clean up their workspaces. Workspaces should not be used for years on end. Best practice is to either delete workspaces when the task at hand is complete or empty it. They can always redownload current copies as needed. This keeps workspaces small and managable. You can create a report of users and their current workspaces. Give them a goal to delete any they are no longer using to get below 10. Train them to keep workspaces temporary. They should not be used to store unfinished work for long periods of time.
I am doing this now. I found 45 disconnected users in one of our Windchill systems, we have 3. I am deleting all workspaces that do not have new or modified files in them. I am removing all unmodified files from workspaces that have new/modified files in them.
Here is the SQL script I used to get the Usernames and their workspaces.
Taking advantage of what was shared in this discussion, https://community.ptc.com/t5/Windchill/Workspaces-with-their-sizes/td-p/1030295
I also involved the CAD representatives from the various departments so that they could “push” their users to manage WS better.
I also discovered something unexpected in the deletion of empty workspaces (the above discussion also mentions a report for cases like these).
Basically, if a user creates a WS, enters CAD data into it, and never uploads it to the server, the report returns this WS as empty even though it is not.
When the WS is deleted from Windchill, the data is NOT physically deleted from the user's local cache, but it is no longer visible from Windchill.
It must be recovered using the application created by a community user (see image).
@TDT @mmeadows-3 @avillanueva @BenLoosli @Marco_Tosin ,
Thanks everyone for your responses.
As per the suggestions, I think I will try out deletion on EPMDocuments from workspaces instead of deleting from Database directly.
Now, any suggestion on how this can be achieved for bulk items? As informed, there are hundreds of thousands of files which needs to be deleted from hundreds of workspaces.
Thanks
Hari
Churn and burn. So long as your making forward progress, you can have a screen on a second monitor with the list of workspaces to delete, a QML Report preferrably. Do your normal daily work and every so often, pop over and delete a few workspaces. It will run in background but deleting a workspace will knock out hundreds and thousands of the EPMDocuments. You will eventually get this done. Note also since your are deleting so much data, you will want to retune the database and you should also run removal of unreferences files from the file vaults when complete.
Hello @HM_12234470,
It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution.
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
Thanks,
Vivek N.
Community Moderation Team.
