How to restore jobs in Jenkins?
jenkins
Solution
I deployed the jobs (and plugins and credentials) using the deploy user and forgot to set the ownership to `jenkins:jenkins`.
I realized this by reading the Jenkins logs at `/var/log/jenkins/jenkins.log`, there were some "Permission denied" messages.
Problem
In the docs it says that all you have to do is copy the files or folders. But when I do that and then try to restore by restarting the service and using the GUI `Manage Jenkins > Reload Configuration from Disk` (btw, is there a way to do this programatically?), only the credentials are restored (they come from credentials.xml which I also copied). No jobs are listed. Any ideas? Edit: I created a directory /var/lib/jenkins/jobs/myjob and inside it I dropped the "config.xml" file. That file used to be in the previous instance of my server, on the same location. I also dropped the old "credentials.xml" into /var/lib/jenkins. That worked fine, I can see the credentials in the web interface.