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:
- Download the script to the filesystem where IdentityIQ is installed.
- 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
- 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.)
- $ ./splitXml.pl /home/spadmin/artifacts/workflows.xml splitWorkflows
- (This creates separate files for each workflow in a subdirectory of the current directory called splitWorkflows.)
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Content to Moderator
We could not install Perl at customer servers to run the script, so I converted it to PowerShell, tested it out, and it works 1:1.
For those interested here is the script, save it as splitxml.ps1:
- « Previous
-
- 1
- 2
- Next »