Is it possible to import multiple XML at once?

Dan51
Giga Contributor

Hello!

Before a clone I export my update sets to xml, save them in a folder, then once the clone has happened import the xml one by one. This seems like a bit of a waste of time and that we are adding a human layer in here which could be prone to error.

Is there a way of automating this so it selects all my files from a folder or selecting multiple XML files to import so they run sequentially?

 

Thanks a lot!

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Dan,

Unfortunately you would require something custom for this i.e. 

1) setting up of mid server

2) write mid server script include which will fetch the xml files and upload in the instance

3) have a code similar to the one of applying update set i.e. preview, commit etc

So I think best method would be a human intervention to avoid any errors

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

17 REPLIES 17

What's your use case here Jason? For example:

  • Could these XMLs be exported from their source into a single file? If those 108 XMLs have originated from the same ServiceNow table; would it be possible to form a single "IF" query (even with 108 "OR" conditions!) to export these records into 1 file at source?
  • If these XMLs do not originate from a ServiceNow instance, StackOverflow has several solutions for merging XML e.g. c# - What is the fastest way to combine two xml files into one - Stack Overflow
  • Is this a once-off import? You may be able to run e.g. a Python script to upload them one at a time
  • Otherwise, the consensus on other related posts seems to be that ServiceNow has no supported solution for importing multiple XMLs at once; some suggest the use of a script running on a MID server

The are all different tables.

 

If your changes are stored in Update Sets, then you can use Update Set Batching to export them all into a single batch-parent Update Set XML, then post-clone you can preview and commit them all in one go:

 

https://docs.servicenow.com/csh?topicname=us-hier-overview.html&version=latest

 

Hope this helps for restoring sub-production instance configuration following future clones,

 

Chris