How to downgrade Jenkins plugins through commandline

Jenkins keeps the back up of old versions of plugins during upgrade process. So we can downgrade it by replacing the backup files.

This tutorial explains the steps to downgrade Jenkins plugins through commandline.

Step1: Shut down Jenkins.

#systemctl stop jenkins

Step2: Change the location to Jenkins plugins folder.

#cd /var/lib/jenkins/plugins

Step3: Delete the folder and file corresponding to the require plugin.

#rm -rf plugin-name
#rm -rf plugin-name.jpi

Where plugin-name need to be replaced with the corresponding value.

Step4: Place the backup file.

#cp -a plugin-name.bak plugin-name.jpi

Where plugin-name need to be replaced with the corresponding value.

Step5: Start Jenkins.

#systemctl start jenkins

That's all…