We are using the "new, scriptable build system" of TFS 2015 and all of a sudden one of our build definitions is gone. It seems that it deleted itself.
Is there a way to undelete/recover a build definition?
Where are the build definitions (those JSON files) acutally stored?
Simply go to the pipelines overview and click on the 3 dots, click on the view deleted pipelines and recover the pipeline.
Job configs are stored on disk under $JENKINS_HOME/jobs , so if you have a backup of that directory, then you can restore the job. Otherwise, there's no "recycle bin" for deleted jobs in Jenkins.
If you are on prem and you just chose delete from the GUI... run this in the TFS database for your specific id:
update Build.tbl_Definition
set Deleted = 0 --was 1
where DefinitionId = <your build ID goes here>
You will loose your build history without some extra work i did not take the time to dig into, but that might also be do-able.
NOTE: You will also loose credentials stored as build parameters you will need to recreate. Might even be best for you to recreate a new build using this as a template to avoid other unknowns.
TFS build definitions are not version controlled items. So, It's not possible to restore the deleted build definitions for now.
There has been a feature request in uservoice: provide a way to version-control build definitions According to the response from PM, this is still in process.
In the new build system coming with TFS 2015 you can see the full history of the changes to your build definition. The feature that is currently missing is the ability to undo or rollback to a previous revision.
We expect to get the rollback deployed to our service in the next few months.
Chris Patterson
Program Manager
Moreover, the build definitions are stored in the TFS database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With