Original article published at Datamanagement.es >> by Francisco Rodriguez Alfaro
How many times have you find yourself working on different projects at the same time with Pentaho, having to change the configuration file “kettle.properties” from “.kettle” each time? If this is your case, read on.
On this article I will show how to configure Pentaho Data Integration to manage several projects simultaneously, without having to change the configuration file every time you switch projects.
Settings
What we want to achieve is configuring Spoon to be able to use multiple configuration files at once, avoiding a “.kettle” switch before opening a project, or modifying the “KETTLE_HOME” variable every time we open different projects.
For instance, let’s take two projects, each one with a different configuration file, so it is normally impossible to work with both at the same time, since Pentaho loads a “.properties” file in each instance. This file is located either in the User’s folder or in the PATH found in the system variable “KETTLE_HOME”. Now we’ll see how to overcome this limitation.
Example projects structure
Proyect 1
Within the project make a copy of the .kettle folder currently used by the project.
The content of the kettle.properties and variables for Project 1 are as follows:
Proyect 2
This is the structure of Project 2 with the .kettle that belongs to it.
Content of kettle.properties and variables for Project 2 are the following:
Spoon.bat settings
Now that we have the .kettle of the copied project in the project path, we must modify the Spoon.bat file that Pentaho runs, so that it accesses the project file:
You have to make two copies of this file and rename them, for example:
- Spoon_Proyecto_1.bat
- Spoon_Proyecto_2.bat
Each executable will load the .kettle of the project it refers to whenever Pentaho is opened.
Spoon_Proyecto_1.bat
Edit the file so that when it is executed, it will assign the variables and connections of the .kettle of Project 1, instead of default ones. For that, just edit the file with a text editor and add the line shown in the following image
Once the file has been modified, copy a shortcut in the project folder to this executable.
Now, in the project folder, when opening Spoon it will load the variables contained in the kettle.properties that are in this project.
Spoon_Proyecto_2.bat
Just like Proyect 1, add a single line to the “.bat” file:
Same as for the rest:
Check that Spoon makes use of the variables for each project . You can use a simple print JOB to check project variables:
Case in point, variables for Project 1 are the following:
Running the same test for Proyect_2, we can see variables in kettle.properties for such project:
With this simple process you could have both projects open at the same time in Pentaho. Neat, right?