-limitdir : An optional list of comma separated source directories to limit the import to
-file : The path to the export file that needs to be imported (optional, you can also specify a list of files after the other options)
-filedir :The directory in which the to be imported files live. A list of files can be specified after the options. This directory is put in front of the filename path (optional)
-rules : The path to the rules file that you want to use during the import
-norules : Do not use a rules file (Y/N), default to N
-comment : The comment that will be set for the new revisions of the transformations and jobs caused by the import.
-replace : Set to Y to replace existing transformations and jobs in the repository, defaults to N
-coe : Continue on error. Warning, use with caution as this will ignore validation errors!
-version : Show the version, revision and build date
As mentioned you can specify a list of filenames to be imported after the specification of these options. The files can be any file type that has transformations or jobs in them. In other words, any XML file with <transformation> and <job> entries in them.
Import returns the following error codes:
0 : The import ran without a problem.
1 : a) Some needed arguments or repository information are missing or b) import was not able to connect to the repository connection or c) target repository directory is not existing
2 : Unexpected error during repository import (see also PDI-7296)
6 : When called with option -version
7 : Exception occurred during rule loading
9 : Command line usage printing
Import a single transformation into the repository:
sh import.sh -rep=RepName -user=joe -pass=password -dir=/ktr -norules "samples/transformations/Getting Started Transformation.ktr"
Import all transformations in a directory:
sh import.sh -rep=RepName -user=joe -pass=password -dir=/ktr -norules -filedir=/foo/ $( ls /foo/*.ktr )
Import a repository export with a rules file:
sh import.sh -rep=PRODUCTION -user=joe -pass=password -dir=/import -rules=prod-rules.xml \
-file=UAT-export-20110616.xml -coe=false -replace=true \
-comment="New version upload from UAT"
Beyond the general rules described above you have to provide an "import rules" file to the import utility. The rules allow an administrator to make sure that the quality of the imported repository objects adhere to a certain standard. Those among you that find the built-in rules to be insufficient can write and deploy new rules as plug-ins. For more information see the PDI SDK.
To be valid for the Import utility, the XML described in the rules below need to be placed in an XML document with a parent <rules> element.
A transformation requires a description
Description: This rule verifies that all transformations have a description with a certain specified minimum length.
A transformation has to log to a transformation log table
Description: Verifies that each imported transformation has configured the transformation logging table appropriately. It can also validate that the schema name, table name and connection name contain a certain standard value.
Description: Verifies that each imported job has configured the job logging table appropriately. It can also validate that the schema name, table name and connection name contain a certain standard value.