How can i bulk update the Status value to Retire for 10,000 + records in Net gear (cmdb_ci_ip_switch) and delete relationships of parent or child matching for the Cis?

msr2
Kilo Contributor

Hello All,

We are in process of Retiring 10,000+ records in Net gear (cmdb_ci_ip_switch) and  also delete all relationships if the CI name is matching as parent or child.

Any inputs with best practices if anyone worked on similar case to the above process.

 

Thanks,

Reddy

 

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Can you filter the records you are after? Through a list, for both cmdb_ci_ip_switch as you relationship records? If so you could easily copy the query, and use it in GlideRecord queries through fix script for example. If possible, try to use updateMultiple() and deleteMultiple().

Though like Andrew already mentioned, test this first, on your dev/test environment, with small subsets of your data (for example using setLimit).

Maybe this article is helpful already:
Utilizing the breadcrumb on lists to generate your query

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

7 REPLIES 7

Andrew Barnes -
ServiceNow Employee
ServiceNow Employee

Greetings Reddy,

 When undertaking such a large change, certainly test your changes in a sub-production instance. You will need to decide if you need to run workflows or not as part of the delete. For performing the action, I would suggest a on demand flow or fix script depending on your comfort of scripting. Test and log twice, run once 😄

-Andrew Barnes
Join me at Developer Blog

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Can you filter the records you are after? Through a list, for both cmdb_ci_ip_switch as you relationship records? If so you could easily copy the query, and use it in GlideRecord queries through fix script for example. If possible, try to use updateMultiple() and deleteMultiple().

Though like Andrew already mentioned, test this first, on your dev/test environment, with small subsets of your data (for example using setLimit).

Maybe this article is helpful already:
Utilizing the breadcrumb on lists to generate your query

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Thank you!

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

We have done something similar in past. 

Few important tips: We also Check if there are any incident's, change attached to the CI's which you are deleting. We exported the whole table in excel before deleting it. If you use discovery then it will be discovered again. So make sure you want them to be discovered again or not. If you are retiring those then do that first on network and then do that in servicenow.(Only is Discovery is used.)

 

We created a script to delete this CI and we don't delete the CI if any incident or change is open.


Thanks,
Ashutosh