Downloading and importing a DataStage flow and its dependencies
You can download DataStage® flows and import them into another project, along with any dependencies that the flow has.
You can download individual or multiple DataStage flow and their dependencies in the form of a ZIP file, then import the file into another project. Dependencies of flows include items such as connections, subflows, or parameter sets.
You can also use command-line tools or the DataStage API to accomplish this task. For more information on using the command-line tools, see DataStage command-line tools.
oc -n ${PROJECT_CPD_INST_OPERANDS} patch datastage datastage --patch '{"spec":{"migration_export_remove_secrets":true}}' --type=merge
Downloading and importing an individual DataStage flow and its dependencies
- In a DataStage flow, click the Download icon on the toolbar.
- Download and save the file to your computer. The downloaded file might include connection assets that have credentials or other sensitive information.
- In a different project, go to the Assets tab, then click New asset. The New asset page opens.
- Locate and click the DataStage tile. The Create a DataStage flow page opens.
- Click Local file, click Browse, then select the ZIP file from your computer. You can also drag the file from your computer onto the page. Then, click Create.
- Select one of the following actions from the drop-down menu for Asset
conflicts:
- Skip
- This action is the default. If an asset or dependency with the same name exists, the asset from the ZIP file is not imported. The import report indicates whether anything was skipped.
- Rename
- The name of the imported asset or dependency is appended with additional information to make the name different from the one that already exists.
- Replace
- The asset or dependency from the ZIP file overwrites any existing assets or dependencies with the same name.
- Select the ZIP file, then click Create.
You can also download an individual flow by using the method that is shown in Downloading and importing multiple DataStage flows and their dependencies and selecting a single flow to download.
Downloading and importing multiple DataStage flows and their dependencies
- On the Assets tab of your project, under Asset types, click DataStage flows.
- Select the flows that you want to download from the list.
- Click Download. A dialog box opens that asks if you removed credentiials from the assets. Click Cancel download to stop or Continue download to proceed.
- Download and save the file to your computer. The downloaded file might include connection assets that have credentials or other sensitive information.
- In a different project, go to the Assets tab, then click New asset. The New asset page opens.
- Locate and click the DataStage tile. The Create a DataStage flow page opens.
- Click Local file, click Browse, then select the ZIP file from your computer. You can also drag the file from your computer onto the page. Then, click Create.
- Select one of the following actions from the drop-down menu for Asset
conflicts:
- Skip
- This action is the default. If an asset or dependency with the same name exists, the asset from the ZIP file is not imported. The import report indicates whether anything was skipped.
- Rename
- The name of the imported asset or dependency is appended with additional information to make the name different from the one that exists.
- Replace
- The asset or dependency from the ZIP file overwrites any existing assets or dependencies with the same name.
- Select the ZIP file, then click Create.
You can also download an individual flow by using this method and selecting a single flow to download.
Asset conflict options
- Importing connections with the Replace/skip option
-
- If the imported connection has the same name and contents as an existing connection, the action is skipped.
- If the imported connection has the same contents as an existing connection with a different name, the action is skipped.
- If the imported connection does not have the same name or contents as any existing connections, the connection is imported.
- If the imported connection has the same name as an existing connection that contains different
contents, the action depends on the selected conflict resolution option. If the
skip
option is selected, the action is skipped and existing values are not changed. If thereplace
action is selected, the existing connection is updated.
- Importing parameter sets with the Replace/skip option
-
- If the imported parameter set has the same name as an existing parameter set, but the type is different, the action is skipped and a warning message is shown.
- If the imported parameter set contains new parameters or value sets, the parameter set is imported and appended into the existing parameter set.
- If the imported parameter set contains parameters of the same name and type or value sets of the
same name, but different values, the action depends on the value of
replace_mode
.If you setreplace_mode=hard
, the values for the parameters and value sets are updated on import. If you setreplace_mode=soft
, the action is skipped and existing values are not changed. - If the imported parameter set contains a subset of the parameters and value sets in an existing parameter set, the import does not affect the extra parameters and value sets.
Exporting DataStage assets via a Command Line Interface (CLI)
- Export individual assets
- The "export-zip" can be used to export individual flows or pipelines (and their dependencies) by
default, for
example:
cpdctl dsjob export-zip --project dsjob --name Test-DataStage-Flow --file-name test-export-project.zip
cpdctl dsjob export-zip --project dsjob --pipeline=testloop2 --file-name test-export-project.zip
- Export individual assets without dependencies and secrets
- You can export a flow or pipeline without dependencies by using the
--no-dep
option. You can skip exporting secrets such as passwords by using--no-secrets
option.cpdctl dsjob export-zip --project dsjob --name Test-DataStage-Flow --file-name test-export-project.zip --no-deps --no-secrets
- Export multiple assets
- You can export multiple flows and pipelines in a ZIP file, for
example:
cpdctl dsjob export-zip --project dsjob --name={fsTarget,dsTarget} --pipeline={testloop2,testPipe} --file-name test-export-project.zip
cpdctl dsjob export-zip --project dsjob --name fsTarget --name dsTarget --pipeline testloop2 --pipeline testPipe --file-name test-export-project.zip
What to do next
See Migrating DataStage jobs for more information on other configuration changes that you might need to make.