Page 1 of 1

Debian Squeeze: Upgrade cacti to latest version

Posted: Tue Mar 05, 2013 11:47 am
by ^rooker
There is a HowTo on "Debianhelp.co.uk" for upgrading Cacti, but it doesn't keep the "debianized" configuration and location of files, so here's my approach:

1) Backup your current Cacti MySQL database:

Code: Select all

$ mysqldump -l --add-drop-table cacti > mysql.cacti
Note: You will probably have to specify the -u and -p flags for the MySQL username and password. This user must have permission to read from Cacti's database or you will end up with an empty backup.

2) Backup your current Cacti installation:

Code: Select all

$ sudo tar -cjvf cacti-backup.tar.bz2 /usr/share/cacti
3) Download the newest Cacti tarball:
Go to the Cacti Download page and copy the "Linux/Unix in tar.gz format" link.
Then you can use "wget" to download it on your server. For example:

Code: Select all

$ wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
Unpack this tarball and you will have a folder called "cacti-0.8.8a" (or whatever version it is you've downloaded).

4) Rearrange the Cacti folders to match Debian's layout:
Adjust the version number to fit your setup, and run the following commands inside your home directory.

Code: Select all

cd cacti-0.8.8a
mkdir -p ~/cacti/site
mv * cacti/site
mv cacti/site/cli cacti/
mv cacti/site/resource cacti/
This should result in a folder with the following structure:
cacti/cli
cacti/resource
cacti/site
5) Point the database settings to "/etc/cacti/debian.php":
Compare the old (Debianized) and current "cact/site/include/config.php". You will find that the debianized version points at /etc/cacti, like this:

Code: Select all

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
require('/etc/cacti/debian.php');
Replace the default config.php MySQL settings with that code.

6) Replace the old installation with the new one:

Code: Select all

sudo mv /usr/share/cacti ~/cacti-BACKUP
sudo mv ~/cacti /usr/share/cacti
7) Open the Cacti site in your browser:
You should then be presented with upgrading/installation steps of your new Cacti version.