How to export/import the Jenkins configuration?

拈花ヽ惹草 提交于 2019-11-29 01:14:45

There is no simple way to backup/export selected parts of the configuration, since Jenkins configuration data is scattered among

  • several files (global config.xml, lots of plugin-specific files)
  • several sub-directories (credentials, nodes) and
  • some of the files are encrypted (credentials), so you must also backup the encryption keys

The cleanest solution will be to back-up the entire $JENKINS_HOME, and to exclude those parts that you do not want to be part of the backup (e.g., exclude jobs/*/builds). With that you'll end up with a resonable backup size also.

Such a backup must be done on filesystem level, as there's no API to access all those files/data.

Do not rely on thinBackup, as you depend on the plugin maintainers to not miss anything important. E.g., as of version 1.7.4, thinBackup does not backup Jenkins' secret keys, so it's impossible to restore credentials from scratch.

Eugene V

Maybe thinBackup plugin will help you.

The mentioned requirement can be easily achieved using the below plugin

https://wiki.jenkins-ci.org/display/JENKINS/JobConfigHistory+Plugin

Below issues will be solved while using this plugin

  • Config changes are versioned
  • Config changes can be compared
  • Config changes can be reverted back
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!