Clone or import a pipeline
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
One approach to creating a pipeline is to copy an existing pipeline and use it as a starting point. For YAML pipelines, the process is as easy as copying the YAML from one pipeline to another. For pipelines created in the classic editor, the procedure depends on whether the pipeline to copy is in the same project as the new pipeline. If the pipeline to copy is in the same project, you can clone it, and if it is in a different project you can export it from that project and import it into your project.
Cloning a classic pipeline also clones its settings, such as variables, triggers, and options. Security settings aren't cloned. Cloning a YAML pipeline only copies the YAML content, and you need to reconfigure any other settings.
For information in migrating a classic build pipeline to YAML using Export to YAML, see Migrate from classic pipelines.
Clone a pipeline
For YAML pipelines, the process for cloning is to copy the YAML from the source pipeline and use it as the basis for the new pipeline.
Navigate to your pipeline, and choose Edit.
Copy the pipeline YAML from the editor, and paste it into the YAML editor for your new pipeline.
To customize your newly cloned pipeline, see Customize your pipeline.
Go to the pipeline details for your pipeline, and choose Edit.
Copy the pipeline YAML from the editor, and paste it into the YAML editor for your new pipeline.
Note
When copying from a classic pipeline, select the agent job, View YAML, Copy to clipboard, then paste to the YAML editor for your new pipeline. You can repeat these actions for each job in the pipeline.
To customize your newly cloned pipeline, see Customize your pipeline.
Note
When cloning a YAML pipeline, only the YAML content is copied. You need to reconfigure any other settings defined outside the scope of the YAML content, such as variables, triggers, security, and other settings.
Export and Import a pipeline
You can create a new classic pipeline by exporting an existing one and then importing it. This is useful in cases where the new pipeline has to be created in a separate project.
In a YAML pipeline, exporting from one project and importing into another is the same process as cloning. You can copy the pipeline YAML from the editor and paste it into the YAML editor for your new pipeline.
Navigate to your pipeline, and choose Edit.
Copy the pipeline YAML from the editor, and paste it into the YAML editor for your new pipeline.
To customize your newly cloned pipeline, see Customize your pipeline.
Go to the pipeline details for your pipeline, and choose Edit.
Copy the pipeline YAML from the editor, and paste it into the YAML editor for your new pipeline.
To customize your newly cloned pipeline, see Customize your pipeline.
Next steps
Learn to customize the pipeline you cloned or imported.