What to backup in Jenkins
You can backup the whole $JENKINS_HOME directory, but the most important are:
- $JENKINS_HOME/*.xml - configuration files (Ex. config.xml)
- $JENKINS_HOME/jobs/*/*.xml - jobs folder - if you want to save your CICD pipelines
- $JENKINS_HOME/nodes/* - agent configuration
- $JENKINS_HOME/plugins/*.jpi - Plugins installed
- $JENKINS_HOME/secrets/* - Secrets for credentials
- $JENKINS_HOME/users/* - users folder
Also, you can use this script to do the above:
jenkins=backup-script