How to restore jenkins from aws (s3bucket)?
Step 1:- Log into server
ssh rooot@ip
apt-get update
apt-get install awscli
aws configure
aws s3 cp s3://jenkins-new-server/apachebackupfile name .
aws s3 cp s3://jenkins-new-server/backupfile name .
apt-get update
apt-get install apache2
apt update
apt install mysql-server
tar -xvf jenkinsbackup file name.tar
Note: If this restoration is done in new server we need to install java and jenkins,if it is old server we need to check whether we have or not
Step 2:- Install Jenkins on the server. The version of Jenkins included with the default Ubuntu packages is often behind the latest available version from the project itself. To take advantage of the latest fixes and features, you can use the project-maintained packages to install Jenkins.
Step 3:- Add the repository key to the system
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
Step 4:- When the key is added, the system will return OK. Next, append the Debian package repository address to the server’s
Sources.list: sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Step 5:- When both of these are in place, run update so that apt will use the new repository
sudo apt update
Step 6:- Finally, install Jenkins and its dependencies
sudo apt install jenkins
Now that Jenkins and its dependencies are in place, we’ll start the Jenkins server.
Step 7:- Starting Jenkins
sudo systemctl status jenkins
Sudo systemctl start jenkins
Note: If everything went well, the beginning of the output should show that the service is active and configured to start at boot. When we start or check the status of jenkins if there is any error troubleshoot accordingly with the errors.
Step 8:- Access jenkins in browser http://ip:8080
Step 9:- Install Java 8 version
sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre
To verify the version
java -v or java -version
