Remove Duplicate CI

Mark Wood
Tera Contributor

Hello Experts,

I am new to CMDB, I want to remove duplicate CI from the computer class What should be the best approach to remove duplicate CI. How can I remove duplicates Please guide me on this. thank you

1 REPLY 1

Jan Cernocky
Tera Guru

Hi Mark,

first of all, do you know how the duplicates were created? Was that a one time action or are they being created randomly? That would be my first step to make sure it is not being created again and again.

 

Next, if there is a duplicate, do you have any other actions connected to it? Meaning are both of them being updated by some integration or whatever. Simply looking for an attribute that could distinguish duplicates (e.g. Updated only changes for one record and all other records with same name but older Updated date can be deleted). Btw what exactly you mean by duplicate. Are we talking about the name of the computer or all parameters?

 

Last, how many records are we talking about?

 

Anyway, instead of deletion (where things can go wrong very quickly), maybe try to utilize some of the out of the box fields first. E.g. on records you identify as duplicates, set the Operational status to Retired. Once everything works well, you can always delete such records later. It will also help you because I believe there are some reference qualifiers that filter out Retired machines, e.g. when you try to select a CI from Incident form.

 

For the process of change (either the status, or the deletion - but I warned you 😉 

1. If it is not too many records, I would go simply by setting proper filter, then multiselect and do the needful.

2. If you want to be on a safe side, you can export the entire table to XLS, including sysIDs, then change what you need (operational status, add prefix 'to be deleted' to name or whatever), delete untouched rows from the XLS, and import them back to make a bulk change.

3. Lastly, you can use purely scripting. Find a proper condition that distinguish what needs to be modified or deleted and write corresponding script. Two things to keep in mind! 

   a. Make a backup of the table prior running the changes (if we are talking about big number of computers)

   b. Do not run it in the production instance immediately. Develop it in sub-production (I believe I do not have to stress it out!) and put there a logic that will count you a total number of affected records but do not modify or delete it yet. Once you see the number and it matches of what you expect, then run that script again with that action.