I am hoping someone can help me. I am looking to search out and remove duplicates of network devices where the name is the same. I wish to keep the newest record. Can someone direct me to how this can be done cleanly? I wish to remove all references to the duplicates.
Thanks
Greg
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is probably a better way but usually I query the view's from within MySQL first to get the ID's of the duplicates. Once you have a list of ID's you can run an OQL query within iTop and use the mass-delete option. The following example is for Person CIs though can be applied to just about anything.
1.Get the list of duplicated Object IDs.
MYSQL> SELECT count(*) as count, group_concat(id), email, employee_number, friendlyname FROM `view_Person` where status='active' group by friendlyname having count >1
2.Cleanup the list removing the first "unique" entry. There is probably a complex SQL query which can do this for you. For the sake of time I bring this list into Excel and clean it up there.
3.With iTop's query tool select all of the objects with their matching IDs
OQL> SELECT Person WHERE id IN (6153,6154,6257,6258,6259)
4.From the resulting list select Delete under "Other Actions".
Last edit: lndevnull 2015-06-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the reply, I have done something similar in the past and it has worked with mixed results.
I have noticed that anything big brought into OQL seems to time it out. I am needing to scan through 60K records for duplicates...I will keep plugging away.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi folks,
I am hoping someone can help me. I am looking to search out and remove duplicates of network devices where the name is the same. I wish to keep the newest record. Can someone direct me to how this can be done cleanly? I wish to remove all references to the duplicates.
Thanks
Greg
Any advice folks? Sure hoping one of the gurus chimes in.
Any advice on removing duplicate CIs period? Has anyone had to do this in bulk?
There is probably a better way but usually I query the view's from within MySQL first to get the ID's of the duplicates. Once you have a list of ID's you can run an OQL query within iTop and use the mass-delete option. The following example is for Person CIs though can be applied to just about anything.
1.Get the list of duplicated Object IDs.
2.Cleanup the list removing the first "unique" entry. There is probably a complex SQL query which can do this for you. For the sake of time I bring this list into Excel and clean it up there.
3.With iTop's query tool select all of the objects with their matching IDs
4.From the resulting list select Delete under "Other Actions".
Last edit: lndevnull 2015-06-30
Thanks for the reply, I have done something similar in the past and it has worked with mixed results.
I have noticed that anything big brought into OQL seems to time it out. I am needing to scan through 60K records for duplicates...I will keep plugging away.