- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 08:08 AM
Hi - we've been asked to exclude all our HR module data (hr cases, tasks, attachments etc) from our sytem clones
I understand from the documentation that you cannot exclude a table inherited from the task table.
THe queston is whether anyone has found a way to only partially exclude data from the task table (i.e. where task type is HR task or HR case)?
I've just spent the whole day running a background script to delete the data after the clone, and I think this will become more of a time issue hte more data is intered ito our system.
Also, I added a simple exclude on the sys_attchments table which doesn't seem to have worked either..
Has anybody encountered or overcome anything like this?
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 09:54 AM
Use the GlideTableCleaner API. It is optimized for speed and performance. For example, here's a piece of code that would delete any incident record created more than 1 second ago. The API also automatically detects and deletes related attachment records.
new GlideTableCleaner('incident', 1, 'sys_created_on').clean();
NOTE: Since this API is not documented it is not officially supported. Beware.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 08:29 AM
Adrian,
You should be able to exclude the hr_profile table itself. But to make sure none of the information is present (like HR cases), your best solution are Clone Cleanup Scripts that purge the data tables in question.
There's some other information here about it: Protecting Sensitive Employee Information
Hope that helps. I'd personally use a Clone Cleanup Script that just wipes the tables. They will run immediately after cloning and purge the data.
-Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 08:40 AM
Many thanks Rob for the prompt reply.
I guess the cleanup script would work, but at the moment the background scripts I ran manually to delete the attachments, and hr cases took many hours to run - over 8 hours for the cases and attachments ran overnight. My concern is that in a year or two with more data in this process could run for several days. Would the script run faster as part of a Clone Cleanup script? I'm using syntax like..
doit("sys_attachment");
//for example doit("sys_attachment");
function doit(table) {
var gr = new GlideRecord(table);
gr.addQuery('table_name', 'IN', 'hr_case,hr_task,sys_email');
gr.query();
gr.deleteMultiple();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 09:54 AM
Use the GlideTableCleaner API. It is optimized for speed and performance. For example, here's a piece of code that would delete any incident record created more than 1 second ago. The API also automatically detects and deletes related attachment records.
new GlideTableCleaner('incident', 1, 'sys_created_on').clean();
NOTE: Since this API is not documented it is not officially supported. Beware.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2017 11:19 PM
Many thanks I'll give this a try for our next clone (due mid-April) and report back!