Ok still not much in the way of PA documentation Here is the upgrade method I used myself. Note this is an extra careful method since my Cacti is a production system and not good if I break it. If this isn't a concern you can just go ahead and extract the whole PA to your working cacti directory.niobe wrote:Any info on whether you can upgrade from 2.0 on a production system and how?
Sorry for Windows people but the specifics of this method are for Unix..
1) Backup your current installation. Attached is a shell script that can handle this for you, but check the variables and permissions are right for your system. The script ensure your mysql database is also backed up.
2) Find zipped copies of PA2.0 and PA2.1 and extract them to separate folders. I can't find PA2.0 on cactiusers.org so it's attached here. You have to rename the directories that get extracted else they will overwrite each other.
Code: Select all
[niobe@cacti CactiStuff]$ tar -xvzf cacti-plugin-arch-2.0.tar.gz
[niobe@cacti CactiStuff]$ mv cacti-plugin-arch cacti-plugin-arch-2.0
[niobe@cacti CactiStuff]$
[niobe@cacti CactiStuff]$ tar -xvzf cacti-plugin-arch-2.0.tar.gz
[niobe@cacti CactiStuff]$ mv cacti-plugin-arch cacti-plugin-arch-2.0
[niobe@cacti CactiStuff]$
[niobe@cacti CactiStuff]$ ls -l | head -n 25
total 29364
drwxrws--- 3 niobe netcomms 4096 Apr 21 12:38 cacti-plugin-arch-2.0
-rw-rw---- 1 niobe netcomms 173324 Feb 13 06:01 cacti-plugin-arch-2.0.tar.gz
drwxrws--- 3 niobe netcomms 4096 Apr 21 12:35 cacti-plugin-arch-2.1
-rw-rw---- 1 niobe netcomms 173327 Mar 23 14:47 cacti-plugin-arch-2.1.tar.gz
Code: Select all
[niobe@cacti CactiStuff]$ diff -r cacti-plugin-arch-2.1 cacti-plugin-arch-2.0
Code: Select all
[niobe@cacti CactiStuff]$ diff -r cacti-plugin-arch-2.1 cacti-plugin-arch-2.0 | egrep 'diff|Only'
Only in cacti-plugin-arch-2.0: cacti-plugin-0.8.7b-PA-v2.0.diff
Only in cacti-plugin-arch-2.1: cacti-plugin-0.8.7b-PA-v2.1.diff
diff -r cacti-plugin-arch-2.1/files-0.8.7b/host.php cacti-plugin-arch-2.0/files-0.8.7b/host.php
diff -r cacti-plugin-arch-2.1/files-0.8.7b/include/global_arrays.php cacti-plugin-arch-2.0/files-0.8.7b/include/global_arrays.php
diff -r cacti-plugin-arch-2.1/files-0.8.7b/include/global.php cacti-plugin-arch-2.0/files-0.8.7b/include/global.php
diff -r cacti-plugin-arch-2.1/files-0.8.7b/include/plugins.php cacti-plugin-arch-2.0/files-0.8.7b/include/plugins.php
diff -r cacti-plugin-arch-2.1/Readme.txt cacti-plugin-arch-2.0/Readme.txt
< patch -p1 -N < cacti-plugin-0.8.7b-PA-v2.1.diff
> patch -p1 -N < cacti-plugin-0.8.7b-PA-v2.0.diff
4a) Simply overwrite/move these files to you cacti installation.
include/global.php will need to have elements re-added to the plugin array so make sure you have a copy of this before overwriting - or your plugins will magically stop working.
4b) Alternatively you can run a second set of diffs - checking the active cacti file against the new one in PA2.1. What we are looking for is the exact SAME output as when we compared PA2.1 to the PA2.0 files. This double checks that you are overwriting PA2.0 files, not something older and that no other changes have been made to those files.
Code: Select all
[niobe@cacti CactiStuff]$ for i in `diff -r cacti-plugin-arch-2.1 cacti-plugin-arch-2.0 | grep ^diff | cut -d' ' -f3 | cut -d/ -f3-
> host.php` ; do diff <path_to_PA2.1>/$i <path_to_cacti>/$i ; done
Now you can compare this output to the output from the first diff in 3). If there are any differences then you want to look at them carefully and figure out what's going on.
If you the output is the same as from step 3) you can go ahead and move the files. Don't forgot to re-add your plugins to include/global.php and check permissions as a final step.
Hope this is useful for somebody..
N