2.2.33 systemimport

usage: systemimport
[ -s|-skipexisting ] 
[ -pp|-preservepermissions ] 
[ -nameconflict re|an|sk|ask ]
[ -keyconflict re|an|sk|ask ]
[ -namekeyconflict rn|rk|an|sk|ask ]
[ -he|-holdexecution [ r|sr|sir|wr ] ]
[ -nr|-norollback ]
[ -no|-newowner]
[ -select <xml-selection file> [ -dryrun ]  [ -onerror < ABORT | ASK | IGNORE > ]  ] 
[ -m|-message ] 
[ -u|-upgrade ] 
[ -eu|-enableusers ] 
<export file|directory> [password]

This command imports a ZIP file or a directory. If an import entry is in conflict with an entry that already exists in the current system, the entry will not be imported. An example of such a conflict might be an identical entry name, but a different ID. This command is only available to the mzadmin user, and therefore all the entries will be imported, regardless of their access permissions.

A workflow group that is scheduled to start while an import activity is happening, will not start until the import is complete.

[-s|-skipexisting]

If you choose to set the skipexisting parameter, the imported data will not overwrite existing configurations that have the same key, name, type, and folder. This means that repeatedly importing a configuration, does not overwrite the data.

[-pp|-preservepermissions]

When user permissions are modified, set the preservepermissions parameter to prevent user permissions in the current system from being updated while importing a configuration.

[-nameconflict re | an | sk | ask]

This parameter enables you to identify an imported configuration with a name that is identical to the name of a configuration that already exists in your system. Using this parameter requires that you specify what you want to do with the imported configuration:

  • re (REplace): Overwrite the current configuration with the imported one.
  • an (Add New): Add the imported configuration to your system. To resolve the name conflict, the new configuration's name is extended with _1 at the end.

Note!

A name that already ends with _n is modified at the end to _n+1.

  • sk (SKip): Ignore the conflicting imported configuration.
  • ask: Prompt when a conflict is detected.

Note!

If you do not set this parameter, the conflicting configuration is skipped and ignored. 

[-keyconflict re | an | sk | ask]

This parameter enables you to identify an imported configuration with a key that is identical to the key of a configuration that already exists in your system. Using this parameter requires that you specify what you want to do with the imported configuration. For information about the keyconflict options, see [-nameconflict re | an | sk | ask].

Example.

The command mzsh mzadmin/dr systemimport -keyconflict ask import.zip is applied with the ask option and detects a key conflict.

 ... 
 [Configuration/Event Notification]  
  - Importing Default.extraKey2... 
 Event Notification configuration with the same key 
 but with a different type, folder or name already exist! 
 
 Existing name is: Default.existingConfiguration 
 Imported name is: Default.importedConfiguration 
 
 What do you want to do? 
 1) Replace existing configuration 
 2) Import as a new configuration 
 3) Skip
> 1 
 Use this alternative for all configurations of this type? 
 1) Yes 
 2) No
> 2

Note!

If you do not set this parameter, the conflicting configuration is skipped and ignored.

[-namekeyconflict rn | rk | an | sk | ask]

This parameter enables you to identify an imported configuration with a name as well as a key that are identical to a name and a key of two different configurations that already exist in your system. Using this parameter requires that you specify what you want to do with the imported configuration:
rn (Replace Name conflict): Replace the configuration that name conflicts with the imported configuration.
rk (Replace Key conflict): Replace the configuration that key conflicts with the imported configuration.
an (Add New): Add the imported configuration to your system.
sk (SKip): Ignore the conflicting imported configuration.
ask: Prompt a message when a conflict is detected.


Note!

If you do not set this parameter, the conflicting configuration is skipped and ignored.

[ -he|-holdexecution [ r | sr | sir | wr ] ]
 

Example. Using the holdexecution parameter

$ systemimport -s -he r export.zip 
$ systemimport -s -he sr export.zip 
$ systemimport -s -he sir export.zip 
$ systemimport -s -he wr export.zip

Use the holdexecution parameter to prevent scheduled workflow groups from being started while importing configurations.

If a workflow or a workflow group does not stop within 5 minutes (300 seconds) when applying systemimport with either one of the following holdexecution parameters: sr, sir, and wr, a timeout will occur. You can change the timeout value  by setting the Platform property mz.import.suppress.timeout.

When import is complete and a workflow group is still running, systemimport -holdexecution [ r | sr | sir | wr ] awaits the current running workflow member to come to a stop, and then restarts the whole group instead of continuing the execution of the member that follows.

If you do not specify any of the r, sr, sir or wr options:

  • A batch workflow or a workflow group will remain suppressed until all the workflows finish executing. Then, the workflow or the members of the workflow group, become idle.
  • A real-time workflow group will return to the running state.

systemimport -holdexecution generates events. To retrieve the events data, configure the Event Notification Editor to transfer it according to your preferences. For information about the Suppressed Event event type, see 4.3.7 Suppressed Event in the Desktop user's guide.

holdexecution Parameters

Select the action that should resolve held executions:

  • r (restart): When the import activity is done, and a workflow group is partly executed, specifying this option will restart that workflow group. Workflow groups that are fully executed, will not be restarted. A workflow that is started manually, will be restarted if it has been stopped.
  • sr (stop and restart): Stops the workflows or workflow groups that are still running after an import is complete, waits for them to come to a stop or finish processing a batch, and then restarts synchronously all the workflow groups and all the manually started workflows that had not executed completely within the timeout boundaries.

Note!

A workflow that becomes Unreachable after a system import has begun, will be restarted only when and if the contact with the Execution Context that it runs on, is regained while still importing.

If a workflow is unreachable when system import is started, the import is aborted and the following error message is generated: Abort Import: At least one wf that is Unreachable.

For further information about the Unreachable state, see 3.1.11 Workflow Monitor in the Desktop User's Guide.


  • sir (stop immediately and restart): Stops the workflows or workflow groups that are still running after an import is complete, even in the middle of processing a batch, and synchronously restarts all the workflow groups and all the manually started workflows that had not executed completely within the timeout boundaries.

    Note!

    An Unreachable workflow is restarted once contact with the Execution Context that it runs on, is regained. For further information about the Unreachable state, see 3.1.11 Workflow Monitor in the Desktop User's Guide.

  • wr (wait for completion and restart): After an import is complete, synchronously restarts all the workflow groups and all the manually started workflows that had not executed completely within the timeout boundaries.

    Note!

    Any workflow that runs past the timeout limit is restarted as soon as it completes execution.

For further information about holding an execution, see the description of the Suppressed workflow group state in the Desktop User's Guide.

[-nr|-norollback]

When you use systemimport, a file that contains rollback information will be created. This file contains data about configuration changes during the system import, and is saved in the directory where you apply the command. You use the rollback file to undo a system import and return to the configuration that you had before the system import.

Note!

Use the importrollback command only to revert the systemimport command and not for the purpose of a system rollback. For further information see 2.2.9 importrollback.

To suppress the creation of the rollback file, provide either a nr or a norollback option.

[-no|-newowner]

Change ownership of the configuration on import. Must match an user already defined in the 6.1 Access Controller.

[-select <xml-selection file> [ -dryrun ] [ -onError < ABORT | ASK | IGNORE >]

The -select <xml-selection file> parameter enables you to:

  • Provide systemimport with an XML file that specifies your selection of configurations and workflow tables.
  • Use [ -dryrun ] to test data compatibility prior to actually importing
  • Use [ -onError < ABORT | ASK | IGNORE > ] to manage an occurrence of an error

XML Selection File


This selection information that you find in the XML selection file corresponds to the selection information that you specify on the System Import tool view, in the Desktop user interface.

The XML selection file consists of two main tags:

  • <configurations>: contains your configuration import selections
  • <workflows>: contains your workflow tables import selections

<configurations>

Select configurations from the <Export file|directory> that systemimport imports.

  • Use the 
  • resolveDependencies attribute to either include (true), or ignore (false), dependent configurations. See the following example.

Example - The resolveDependencies attribute

<import> 
 <configurations>
<!-- Ignoring dependencies of the Default.x configuration-->  
 <configuration name="Default.x" resolveDependencies="false"/>
<!-- Including dependencies of the Default.y configuration--> 
 <configuration name="Default.y" resolveDependencies="true"/>
<!-- Ignoring dependencies of the Default.z configuration--> 
 <!-- Note: Equal to selection of Default.x above --> 
 <configuration name="Admin.C07E02_DEMO_BWF"/>
<!-- Ignoring dependencies of  
  configurations within the folder --> 
 <configuration foldername="systemunits"/>
<!-- Including dependencies of all the  
  configurations in the folder --> 
 <configuration foldername="billing"  
  resolveDependencies="true"/>
</configurations> 
 </import>
  • To import all the configurations that are included in a specific folder, include the following text in the XML file:
    <configuration foldername="myFolder"/>

    Note!

    If you specify configuration selections in the XML file that do not exist in the Export file, a warning is generated. 

<workflows>

This XML tag enables you to use systemimport [-select <xml-selection file>] to import both workflow configurations and their CSV file in one action.
Use this tag to associate workflow tables with CSV data files.

Note!

  • Set the keepOld attribute to true in order to prevent removal of workflow table data which has no match in the export file. Use false to overwrite the data. This parameter is only used during import, and has no effect during export.
  • The onError attribute can either be set from the XML selection file, or from the systemimport in-line command. If set from both, the XML selection file attribute is the value that applies. For further information about the values that you can choose from, see onError. This parameter is only used during import, and has no effect during export.
  • Set the encryptPassword attribute to the workflow configuration password if the workflow configuration is password protected.


Example. The XML selection tags

<import> 
  <configurations> 
  <configuration name="Common.DB_PROFILE"/>  
  <configuration name="Common.APL_PROFILE"  
  resolveDependencies="true"/> 
  <configuration foldername="myFolder"/>  
  </configurations> 
  <workflows > 
  <workflow name="Mobile.FTP_workflow"  
  wfTable="/home/user1/FTP_workflows.csv"/>  
  <workflow name="Mobile.SFTP2_workflow"  
  wfTable="/home/user1/SFTP2_workflows.csv"  
  resolveDependencies="true"/> 
  <workflow name="Mobile.GGSN1_workflow"  
  wfTable="/home/user1/GGSN1_workflows.csv"  
  resolveDependencies="true"  
  onError="ask"/> 
  <workflow name="Mobile.GGSN3_workflow"  
  wfTable="/home/user1/GGSN3_workflows.csv"  
  resolveDependencies="true"  
  onError="ignore"/> 
  <workflow name="Mobile.GGSN4_workflow"  
  wfTable="/home/user1/GGSN4_workflows.csv"  
  resolveDependencies="true"  
  onError="abort"/> 
  <workflow name="Mobile.GGSN5_workflow" 
  wfTable="/home/user1/GGSN5_workflows.csv"  
  resolveDependencies="true"  
  keepOld="false"  
  encryptPassword="password"  
  onError="ask"/>  
  </workflows> 
 </import>

[-dryrun]

Prior to importing, use systemimport with the dryrun switch to verify that the CSV data, such as number of columns or names, matches the contents of the workflow table. If a mismatch is detected a report will be generated.

[-onError]

If the onError attribute is not specified in the XML selection file, the value that you set it to in systemimport, is the value that applies. Otherwise, the attribute value applies. Set [-onError] to any of the following values:

  • ask: to generate an interactive message
  • ignore: to do nothing
  • abort: to abort the command and stop a current configuration import

[-m|-message]

If you want to add a comment when making a systemimport, the -m or -message option can be used as in the following example:

Example - message

mzsh <username>/<password> systemimport -m "My Import" /home/Directory/<file to import>.zip

"My Import" will be the commented.

The comment will replace the default information saved when making a system import, and will both be included in the System Log message that is generated, as well as visible when selecting to view history in any of the configurations in the imported data.

[-u|-upgrade]

When exports have been made in a previous version of, they may have to be upgraded. In this case you can use the -u or -upgrade option as in the following example:

Example - upgrade

$ mzsh <username>/<password> systemimport -u <file to import>.zip

The configurations will then be upgraded.

[ -eu|-enableusers ] 

If you want imported users to be active after you run the import, use the -eu or -enableusers option as shown in the following example:

Example - enableusers

$ mzsh <username>/<password> systemimport -eu <file to import>.zip

By default users are imported as inactive and must be activated manually via the Access Controller. This option is only available when you run an import as a super user. If you use this option as another user, users will be skipped during the import.

<export file|directory>

Specify the path to the directory or ZIP file that contains the configurations you want to import.

[password]

To import encrypted configurations, provide a password.

Return Codes

Listed below are the different return codes for the systemimport command:

CodeDescription

0

Will be returned if the command is successful.

1

Will be returned if the argument count is incorrect or argument(s) are invalid.

2

Will be returned if the command was unable to find an export (file|directory) at the supplied path.

3

Will be returned if the import could not be started due to locked import.

4

Will be returned if any errors were reported during the import.

5

Will be returned if the XML file did not contain any configurations or workflows to import.

8

Will be returned if the XML file did not contain any workflows to use in dry run.

10

Will be returned if the import results in invalid workflows due to compilation errors. 

14

Will be returned if there are configurations not imported

20

Will be returned if the value for a supplied option or option is missing.

100

Will be returned if an error occurs while parsing the selection file

101

Will be returned if an error occurs while parsing a node in the selection XML file.

102

Will be returned if an error occurs while getting the attribute from a configuration tab, or if expected wfTable attribute in tag with the supplied name is missing.

103

Will be returned if the import was unable to parse the value for a booolean XML attribute.

104

Will be returned if an error occurs while parsing dependencies for a configuration.

300

Will be returned if an OutOfMemoryError occurs during import. Additional information from the "critical error log" will be included, this is further described in 2.12 Out of Memory Info in System Log in the System Administrator's Guide.