One Star

How to batch import jobs to a new environment

What is the best way to batch import jobs into a new environment?
I am migrating jobs from Dev > Prod, and our prod environment has different values for context variables than our Dev environment. For this reason, if I want to move a job from Dev to Prod, I need to export the job from Dev (using the studio), and then use the studio to import to prod. After importing to prod, I then need to open each job individually in order to refresh the context variables from the repository. Then I have to save each job to preserve the values.
Is there an easier way to do this with the commandline or something? Ideally I would like to create a script that would have all the commands needed to perform this operation, but I don't know how to do it. Is this possible and how can it be accomplished?
I am using TIS 4.1.2.
Thanks.
5 REPLIES
One Star

Re: How to batch import jobs to a new environment

Hi
Here is a workaround.
Use tContextLoad to load context variables dynamically from a delimited file(e.g.) when you run the job with different environments.
You can get a scenario in the TOS document.
Regards,
Pedro
One Star

Re: How to batch import jobs to a new environment

Pedro,
Is it possible to use the commandline to import a job into a project?
Thanks.
One Star

Re: How to batch import jobs to a new environment

Hi
I have tried to call a talend job in a java project with several parameters. For example, pass Strings into Job's main() method.
Unfornately the parameters can't be available in the job.
There isn't any method to pass the values. This only exists in TOS 5.0.1. It works in the previous versions.
Using tContextLoad is more stable.
Regards,
Pedro
One Star

Re: How to batch import jobs to a new environment

Pedro,
My question was a little different. I understand what you are saying about loading contexts. My question is more related to whether it is possible using the commandline to import jobs into a project. So if I have a lot of jobs to move from one environment to another, is it possible to accomplish this using the commandline? Or do I need to use the "Import Items" feature in the studio? I am trying to find a way to import jobs into a new environment without using the studio. Ideally, I would like to use a script to do this to reduce human error.
Thanks.
One Star

Re: How to batch import jobs to a new environment

Hi
Got it.
In commandline.bat or commandline-linux.sh of TIS, there is a command "ImportItems".
But I don't think you can create a script to do so. Because it needs to call interfaces of Talend core.
Regards,
Pedro