Export tables as XML using script

peterdurup
Mega Contributor

Hi.

We are running an on-premise installation, and the automatic clone process is not supported for on-premise databases when the size is as large as ours.

So to clone we follow a process described by ServiceNow where the whole database is restored at the development instances.

To do that I need to export the files in the preserved files list to a format where it is easy to restore them. That is why I want to make a script that can export the files to XML format, and another script that can import them after the clone is finished.

So my question is; is it possible? And how do I make such a script?

Kind regards

Peter Durup

1 ACCEPTED SOLUTION

I can see 2 more ways to achieve this.



1) Using system export sets you can export XML data to a mid server from any table after applying filters



Export sets



2) There is another workaround using XML web services http://wiki.servicenow.com/index.php?title=XML_Web_Service#Available_URL_Parameters.



The XML based URL reads all data content in XML. You can filter data based on sysparm_query.



https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1&sysparm_orderby=assigned_to



Load the URL and save the file and Yes if you need it to be scripted, we should read the URL and download the file.



Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

4 REPLIES 4

Alikutty A
Tera Sage

Hi Peter,



You should be looking at the multiple table export tool created by John Andersen



Multiple Table Data Export Tool for ServiceNow | John Andersen





Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response


peterdurup
Mega Contributor

It seems fine, but when I try to run it I get this error message:



Illegal attempt to access class 'com.glide' via script.



Could it be that it is not possible to use the tool in Helsinki?


I can see 2 more ways to achieve this.



1) Using system export sets you can export XML data to a mid server from any table after applying filters



Export sets



2) There is another workaround using XML web services http://wiki.servicenow.com/index.php?title=XML_Web_Service#Available_URL_Parameters.



The XML based URL reads all data content in XML. You can filter data based on sysparm_query.



https://<instance name>.service-now.com/incident_list.do?XML&sysparm_query=priority=1&sysparm_orderby=assigned_to



Load the URL and save the file and Yes if you need it to be scripted, we should read the URL and download the file.



Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response


I and going for the export sets functionallity, it seems to suit my need.


Thanks for your help.