CentOS7 Cacti Virtual Appliance Upgrade commands

Here is a list of steps for upgrading my Cacti virtual appliance in place retaining all data. This will only work on the Centos7_Cacti-v1.1.0 or greater. This assumes you are still using the original Cacti user, passwords, and paths.

If there is anyone out there with scripting skills that wants to help me incorporate this into the appliance let me know!

#This is for use in the Cacti Virtual Appliance CentOS7_Cacti-v1.1.0 or greater
sudo su

#Best to backup Cacti DB before upgrading
mysqldump –user=cacti –password=cacti -l –add-drop-table cacti |gzip > mysql.cacti_$(date +\%Y\%m\%d).sql.gz

#Begin Cacti upgrade
cd /var/www/html
#Find & Relpace any entries with the new Cacti version upgrading to. Ex 1.1.2 to 1.1.4
wget http://www.cacti.net/downloads/cacti-1.1.4.tar.gz

tar xzvf cacti-1.*.tar.gz
#Optional – Cleanup download file
rm cacti-1.*.tar.gz

rm cacti

#Change line below to OLD version of cacti you are coming FROM.
mv cacti-1.1.2/ cacti_old/

ln -f -s cacti-1.1.4 cacti

#Edit Cacti config file
#Change the lines with ‘cactiuser’ to ‘cacti’
vi cacti/include/config.php

rm -rf cacti/rra/
mv cacti_old/rra/ cacti-1.1.4/

cp -u -R cacti_old/plugins/* cacti/plugins/
cp -u -R cacti_old/scripts/* cacti/scripts/
cp -u -R cacti_old/resource/* cacti/resource/

mkdir cacti/config_backups

cd cacti
chown -R cacti:users resource/ scripts/ rra/ log/ plugins/ images/ include/
chown apache:apache cache/realtime
chgrp apache log/cacti.log

cd ..

#Optional – cleanup old folder
rm -rf cacti_old/

#Optional but recommended – Upgrade Spine
cd ~
wget http://www.cacti.net/downloads/spine/cacti-spine-1.1.4.tar.gz
tar xvzf cacti-spine-*.tar.gz
rm cacti-spine-*.tar.gz
cd cacti-spine-*
sudo make install
rm -rf cacti-spine-*
sudo su
cd /usr/local/spine/bin
chown root:root spine;chmod +s spine