Skip to main content
Pentaho Documentation

Import and Export PDI Content

Overview

Indicates how to import and export PDI content using PDI's built-in functions.

You can import and export PDI content to and from a repository by using PDI's built-in functions, explained in these subsections.

Among other purposes, these procedures are useful for backing up and restoring content in the solution repository. However, users, roles, permissions, and schedules will not be included in import/export operations. If you want to back up these things, you should follow the procedure in Backup and Restore Pentaho Repositories instead.

Import Content Into a Repository

Follow the instructions below to import the repository. You must already be logged into the repository in Spoon before you perform this task.

  1. In Spoon, go to Tools > Repository > Import Repository.
  2. Locate the export (XML) file that contains the solution repository contents.
  3. Click Open. The Directory Selection dialog box appears.
  4. Select the directory in which you want to import the repository.
  5. Click OK.
  6. Enter a comment, if applicable.
  7. Wait for the import process to complete.
  8. Click Close.

The full contents of the repository are now in the directory you specified.

Use the Import Script From the Command Line

The import script is a command line utility that pulls content into an enterprise or database repository from two kinds of files: Individual KJB or KTR files, or complete repository export XML files.

You must also declare a rules file that defines certain parameters for the data integration content you're importing. We provide a sample file called import-rules.xml, included with the standard Data Integration client tool distribution. It contains all of the potential rules with comments that describe what each rule does. You can either modify this file, or copy its contents to another file; regardless, you must declare the rules file as a command line parameter.

Options

The table below defines command line options for the import script. Options are declared with a dash: - followed by the option, then the = (equals) sign and the value.

Parameter Definition/value
rep The name of the enterprise or database repository to import into.
user The repository username you will use for authentication.
pass The password for the username you specified with user.
dir The directory in the repository that you want to copy the content to.
limitdir Optional. A list of comma-separated source directories to include (excluding those directories not explicitly declared).
file The path to the repository export file that you will import from.
rules The path to the rules file, as explained above.
comment The comment that will be set for the new revisions of the imported transformations and jobs.
replace Set to Y to replace existing transformations and jobs in the repository. Default value is N.
coe Continue on error, ignoring all validation errors.
version Shows the version, revision, and build date of the PDI instance that the import script interfaces with.
sh import.sh -rep=PRODUCTION -user=admin -pass=12345 -dir=/home/username -file=myJob.kjb -rules=import-rules.xml -coe=false -replace=true -comment="New version upload from UAT"

Export Content From the Repository

Follow the instructions below to export the repository. You must already be logged into the repository through Spoon to complete this task.

  1. In Spoon, go to Tools > Repository > Export Repository.

  2. In the Save As dialog box, browse to the location where you want to save the export file.
  3. Type a name for your export file in the File Name text box.

The export file will be saved in XML format regardless of the file extension used.

  1. Click Save.

The export file is created in the location you specified. This XML file is a concatenation of all of the data integration content you selected. It is possible to break it up into individual KTR and KJB files by hand or through a transformation.