Showing results for 
Show  only  | Search instead for 
Did you mean: 

Splitting exported XML into separate objects

Splitting exported XML into separate objects

Objects' XML representations can be extracted from IdentityIQ through the IIQ console using the export and checkout commands. The export command writes all objects of one or more types to a single XML file. The checkout command writes a single named object to an XML file.

Frequently, customers want to get all objects of a given type out of the system at once but need them all in separate files (e.g. to store them separately in a source code repository). Though there is no built in console command that does bulk exports into separate files, the attached Perl script can take the output from an export command and parse it into separate files per object.

How to use this script:

  1. Download the script to the filesystem where IdentityIQ is installed.
  2. Use the export command to export all objects of a given type from the console. Note: This script only parses export files that were created with the -clean option  (ID values stripped).
    • > export -clean /home/spadmin/artifacts/workflows.xml workflow
  3. Run this script, providing the export filename and the target directory name. (When no target directory is specified, split files will be written to a subdirectory of the current directory called splitOut.)
    • $ ./ /home/spadmin/artifacts/workflows.xml splitWorkflows
    • (This creates separate files for each workflow in a subdirectory of the current directory called splitWorkflows.)
Labels (1)

Nice tool, thanks for that!

I encountered an issue when using the tool which could be tracked down to "unpretty" XML - the tool relies on the XML being formatted in a specific way.

Aftter using the pretty print functionality (with linebreaks!) of the Notepad++ XML Tools Plugin, everything went smoothly.

Very helpful!

I found an issue where the exported <sailpoint> tags are getting cut off. A good example is the OOTB ObjectConfig object for Link. Even though this isn't a commonly managed object, it breaks the <sailpoint> tags and will break the WAR building process.

To split all XML files exported with ExportScript.txt, you can use the following script:

for f in `ls -1 *.xml`;do
     ./ $f `echo $f | awk '{ print substr($0,8,length($0)-19) }'`

A very nice tool. But I run into an issue with object name contains a single quotation mark. for example: Objects in Requestor's Authorized Scopes

I'm seeing the same issue. Is there a fix for this?

The issues when the names contain things like single quotation marks or certain other characters, can be fixed by making the following modifications to the code:

Search for the part where the script assigns a value to: $objectNameHy.

A few lines above that, are 2 regular expressions that define what should be used for the name. Edit the regular expressions to include the characters that are causing the errors. 

And below the assignment are substitutions that replace things like "&" with "and". Add the appropriate substitutions here to create a normal filename.

By the way: if you want separate xml files, you could also use the SSD XML Exporter. Here's a link to the 3.1 version:

SSD XML Object Exporter 


Im getting as unknown command as above. Can you please tell me how to overcome that

Just now tried the Object Exporter Version 3.0 and it did worked successfully . But Im not still understanding when using the attached script, in the cmd, it is still showing the $ symbol as unknown command. Tried to remove the dollar and executed the remaining command and still showing the result as unknown command.

Nothing but problems with this script.  Not sure if it's because it's running on Windows.  It does not handle various situations well and is just a headache.  Much easier to use the Java based splitter:

Excellent tool, but I expected an error while splitting exported XML files.

The error looks like this:

ERROR: unexpected line: [<Rule language="beanshell" name="Objects in Requestor's Authorized Scopes or Requestee's Assigned Scope" type="RequestObjectSelector">]

I found out that the ' in the name part caused to raise an error!

As a solution, edit the XML file and get rid of ' in the name portion!

After modifying the file, runs like a charm.

Version history
Revision #:
2 of 2
Last update:
‎Jul 25, 2023 06:54 PM
Updated by: