Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recover deleted build definition

Tags:

tfs-2015

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?

like image 580
bitbonk Avatar asked May 18 '16 12:05

bitbonk


People also ask

How do I recover a deleted pipeline?

Simply go to the pipelines overview and click on the 3 dots, click on the view deleted pipelines and recover the pipeline.

How do I recover a deleted Jenkins project?

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.


2 Answers

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.

like image 132
felickz Avatar answered Sep 23 '22 03:09

felickz


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.

like image 22
PatrickLu-MSFT Avatar answered Sep 22 '22 03:09

PatrickLu-MSFT