Welcome to new things

[Technical] [Electronic work] [Gadget] [Game] memo writing

How to backup Jenkins

We changed the server on which Jenkins is running, so we backed up Jenkins and reflected it on the new server.

Just a note in case I need to backup Jenkins again.

How to backup Jenkins

summary

Jenkins is well designed, and all you have to do is copy the entire Jenkins home directory and extract it to the Jenkins home directory at the migration site.

The Jenkins home directory is also listed in the environment variable "$JENKINS_HOME".

procedure

  1. echo $JENKINS_HOME

    • Check Jenkins home directory (in this case "/var/jenkins_home")
  2. cd /var
  3. tar zcf backup.tar.gz jenkins_home

    • Compress the "jenkins_home" directory and save it in the file "backup.tar.gz
  4. At the transition site
  5. cp backup.tar.gz /var/
  6. cd /var
  7. tar zxf backup.tar.gz

    • Extract files to "/var/jenkins_home
  8. Open "http://[where Jenkins is located]/safeRestart" in your browser

    • Jenkins is restarted when the URL is accessed

If possible, it is recommended that both the source and destination versions of Jenkins be up-to-date.

If you get an error about xml 1.1 after restarting

In some cases, after restarting, you may get an error about the xml version. (This has actually happened).

If this happens, don't panic, just open "config.xml" in the Jenkins home directory, modify "1.1" in <?xml version='1.1' encoding='UTF-8'?> to "1.0" and start Jenkins again, as described in the following article.

https://teratail.com/questions/114431

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com