KBEC-00271 - Exporting, Editing, and Importing a Project

Article ID:360032828612
2 minute readKnowledge base
On this page

Problem

How can you make changes in a project without editing multiple steps?

For example, you need to change a property name across multiple procedure steps or a Run Condition in the project, which could involve editing multiple steps in the project.

Solution

To quickly and easily make multiple changes, you can export the project, make changes to it using your editor of choice, and import the project to CloudBees CD (CloudBees Flow).

If you want to keep the jobs that exist in your project, make sure that you use the --excludeJobs true option on the ectool export command. The project is exported without any jobs, and when you re-import it, the jobs are intact.

Before importing the project, do not delete or rename the project, or you will lose your jobs. When you import the project, you must use the --force true option to overwrite the previous project definitions.

These are examples of commands that you can use:

  • C:\ >ectool export sample.xml --path "/projects/sample" --excludeJobs true --withAcls true --withNotifiers true

  • C:\ >ectool import sample.xml --path "/projects/sample" --force true

Before making changes to your project XML file, be sure to make a backup copy. You can re-import the backup copy if there are any issues with your changes.

For more information about the command options in this article, see the export and import command information in the online help.

If you need assistance identifying what to change in your project, contact Customer Support.



What if I import the project while another job is running in it?

If a procedure is running when the import operation occurs, the job will complete using the previously defined procedure. The system takes a snapshot of the procedure when a job starts, so that it will complete the job with previous procedure definition.

What happens if I have an active workflow in this project when the project is imported?

If you make changes to the Workflow Definition, all active workflows continue with the previous Workflow Definition. The system takes a snapshot of the Workflow Definition when it begins execution. However, if a procedure that a workflow’s state calls is changed, the workflow completes with the new procedure definition because the system does not take snapshots of the procedure definitions until they run.