Export

Last modified 21 Jul 2026 12:17 UTC

Use the export command to export repository objects.

Export objects either to the system output (to the console) or to a file by using the option -o, --output, and compress them using ZIP if needed by using the option -z, --zip. Use the -O (--overwrite) option to overwrite an existing output file.

Use the -l (--multi-thread) option to process the export using multiple threads. See how multithreading works.

Example of export to a ZIP file using 4 threads:
./bin/ninja.sh export -o export.zip -z -l 4

Objects exported from midPoint can be filtered by:

  • OID (--oid)

  • Type (-t, --type) - For example, ./bin/ninja.sh export -t user

  • Filter (-f, --filter) - Prefix the filter with % to interpret it as a MidPoint Query Language (MQL) query, or with @ to load it from a file.

Example use of an MQL query
./bin/ninja.sh export -f '%name = "administrator" and familyName = "Administrator"'
Example loading a filter from a file
./bin/ninja.sh export -f @filter.txt

If you choose to load a filter from a file, prefix MQL queries with %, just as you would when specifying them directly on the command line.

Use the following options to modify exported objects before they are written to the output:

  • -ni (--no-container-ids) - Removes container IDs from the exported objects.

  • -ei (--exclude-item) - Excludes selected object items from the export. This option accepts item paths and can be specified multiple times or as a comma-separated list.

The -r (--raw) option exports objects in their raw repository representation. This preserves all repository data required to correctly restore the objects during import. The default value of this option is false.

When exporting objects that will be imported back into midPoint, use the -r (--raw) option.

This is particularly important for shadow objects. With the --raw option, Ninja includes the schema definitions required to correctly interpret shadow attributes during import.

Without --raw, shadow attributes are exported without their schema definitions for backward compatibility. Such exports may not be suitable for re-import.

Was this page helpful?
YES NO
Thanks for your feedback