I create a new CI relation called "Redundant" or "No longer related"
I then import the CI's and their relations from the data source.
I next extract all the relations from my data source but give them a relationship descriptor of "Redundant"
I then extract the same relations from the Service Desk Data base and give them the same relationship descriptor.
Finally I do a delta import with the SD data being the data and the external data being the reco file. What happens is that if a relationship is in the external data and in service desk nothing happens (no difference). If it is in Service Desk but not in the source then the descriptor will get changed to "Redundant" as it is seen as a new record (present in SD but not in external data). The trick is to make the unique key on the import mapping both the cifrom and cito.
Doing it this way, I will not unrelate anything, just change the relation type from "Related to" to "No longer related"? please correct me if im wrong.
I think it would be better to unrelate things, because otherwise we will have ALOT of relations with "No longer related". Almost all our software is created as CI's and people tend to install/update/uninstall all the time.
You are right. The advantage I have seen with changing the relationship descriptor and with some of the later service packs where you can audit CI relations is that you can strat to get some historical picture of what is happening.
If you want to delete these relationships you will need to use something like sd_event which can delete an item. I have done one install where I did a DTS job (it was on SQL - I think there is an oracle equivilent) that extracted all relationships of a certain type ( I was anle to even filter on the CI types) to a text file that was a series of SD_Event.exe calls. The downside of this is that the extract took about 30 seconds to run but the batch file that it created took about 6 hours to run. Also if you delete and then recreate the relations you have to add on the data exchange time so you can end up taking a lot of time to do this.
it is quite easy to unrelate CIs with the Java web-api but it still takes some time, especially when you have CIs with many related CIs (like one parent CI with 5,000 clients related to it). The actual code to unrelate the CIs is about 10 lines of Java. You just have to think about how you like to use it (e.g. as a client app, command line tool or on a Web server)