To preserve the state of the Jenkins Master, the various files in the Jenkins configuration directory at /var/lib/jenkins have to be considered. In general, these files can be categorized as follows:
Config: Configuration files
Cache: Temporary cache files to improve performance
State: Related to the current and past execution
Secrets: Special configuration files which have to be handled with pre-caution (aka must not be stored on a versioning system but rather in a secure storage like KMS).
While Config and Secrets are a crucial part of the CI system and thus require detailed backups and versioning, the Cache can be stored in a non-persistent way. It would be desirable to have the State persisted as this allows to have a seamless experience in between deployments. Due to the fact that the State changes very frequently, no explicit versioning is required.
The analysis and categorization of the existing files is as follows:
caches: Cache fingerprints: State HOOK.groovy.d: Config jobs: Config incubator-mxnet: Config branches: State indexing: State config.xml: Config state.xml: Config
... logs: State nodes: Config plugins: Config secrets: Secrets updates: Config userContent: Config users: Secret State workflow-libs: Config workspace: State