Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Hudson or Jenkins, how can you restore deleted builds?

I accidentally deleted some builds for a job that I would have rather kept. I restored the builds on disk from backup, but they still do not show up when I am on the status page for that job.

I have tried both triggering another build for the job and re-starting Hudson.

How can I fully-restore these builds? Is there a DB that Hudson uses to store this type of information?

like image 539
Kevin Crowell Avatar asked Aug 02 '10 21:08

Kevin Crowell


People also ask

How do I restore a deleted Jenkins build?

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.


1 Answers

Inside your %HUDSON_HOME% directory is a subdirectory called "jobs". Under "jobs" are subdirectories for every project. Inside each one are subdirectories for each build.

You need to make sure that jobs\<projectname> exists, and then copy the missing build directories inside.

Click "Manage Hudson/Reload Configuration From Disk" to make Hudson recognize the newly added builds. Not necessary to restart your servlet container (e.g. Tomcat) if you use one.

like image 141
William Leara Avatar answered Sep 20 '22 04:09

William Leara