Forked from lukaszkorecki/jenkins_copying_configuration.sh
Last active
August 29, 2015 14:24
Revisions
-
lukaszkorecki revised this gist
Jan 29, 2015 . 1 changed file with 5 additions and 8 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,19 +8,16 @@ NEW_SERVER_USER= ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER cd /var/lib/jenkins/ for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar tar zcf /tmp/jenkins_config.tar.gz *.xml users userContent/ plugins/ -T config.totar exit # ON THE NEW JENKINS SERVER ssh $NEW_SERVER_USER@$NEW_JENKINS_SERVER scp $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER:/tmp/jenkins_config.tar.gz $NEW_SERVER_USER@$NEW_JENKINS_SERVER:/tmp/ cd /var/lib/jenkins sudo tar xvzf /tmp/jenkins_config.tar.gz sudo chown -R jenkins:jenkins . sudo service jenkins restart -
mriddle revised this gist
Nov 15, 2012 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,18 +5,22 @@ NEW_JENKINS_SERVER= NEW_SERVER_USER= # ON THE ORIGINAL JENKINS SERVER ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER cd /var/lib/jenkins/ for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar tar zcf /tmp/jenkins_config.tar.gz *.xml userContent/ plugins/ -T config.totar exit # ON YOUR WORKSTATION scp $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER:/tmp/jenkins_config.tar.gz . scp jenkins_config.tar.gz $NEW_SERVER_USER@$NEW_JENKINS_SERVER:/tmp/ # ON THE NEW JENKINS SERVER ssh $NEW_SERVER_USER@$NEW_JENKINS_SERVER cd /var/lib/jenkins sudo tar xvzf /tmp/jenkins_config.tar.gz sudo chown -R jenkins:jenkins . sudo vi config.xml # Remove all the slaves sudo service jenkins restart exit -
mriddle created this gist
Nov 9, 2012 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ ORIGINAL_JENKINS_SERVER= ORIGINAL_SERVER_USER= NEW_JENKINS_SERVER= NEW_SERVER_USER= # ON THE ORIGINAL JENKINS SERVER cd /var/lib/jenkins/ for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar tar zcf /tmp/jenkins_config.tar.gz *.xml userContent/ plugins/ -T config.totar # ON YOUR WORKSTATION scp $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER:/tmp/jenkins_config.tar.gz . scp jenkins_config.tar.gz $NEW_SERVER_USER@$NEW_JENKINS_SERVER:/tmp/ # ON THE NEW JENKINS SERVER cd /var/lib/jenkins sudo tar xvzf /tmp/jenkins_config.tar.gz sudo chown -R jenkins:jenkins . sudo vi config.xml # Remove all the slaves sudo service jenkins restart