Cacti wants do re-install older version
WirthmU opened this issue · comments
Describe the bug
About a month ago I did upgrade to the latest version of Cacti and Spine (v1.2.27) and everything went fine and was running as expected.
For over a week I did not look at the cacti server and now when I log into it, it does so with the installation wizzard for Cacti version 1.2.10, which is in fact a downgrade that is not recommended.
Desktop (please complete the following information)
Headless PC
- OS: [e.g. iOS]
Ubuntu 20.04.6 LTS - Browser [e.g. chrome, safari]
Firefox - Version [e.g. 22]
Do you have Cacti RPMs/DPKs from a packager also installed?
That would do it. It's likely you did an update and reversed a bunch of things.
Better reupgrade
Yea, you have to be careful uninstalling as it will dispose everything. From my perspective, there are a lot of mod's on Ubuntu that complicate a native install, but also conform to Debians rules.
If it were me, I would backup the database using mysqldump and of course backup your RRDfiles, then remove just the Cacti component and then re-install Cacti natively. I'm sure that the spine binary will be fine, though there have been a lot of fixes post 1.2.10 there as well.
For someone like myself, this is a breeze, but for you, it'll be more work. If you don't want to downgrade the database to give you time to test, just update the file cacti_version
in the include
folder to reflect 1.2.27. That way the database will not be downgraded.
I don't have time to walk you through it, you know day job, but maybe you can get some help from someone like @bmfmancini whose favorite distribution is Debian/Ubuntu.
Could I ask you @bmfmancini for some advice to resolve my problem:
get rid of the ubuntu cacti and spine packages and re-install the latest v1.2.27 cacti version natively.
Hey!
Sorry for the late reply been on vacation !
Ok I would follow this procedure make sure you do a backup !!!!
1.) copy /usr/share/cacti/site/include/config.php
2.) you can copy all off the graph files in /usr/share/cacti/site/rra to another folder so you can copy them back later
3.) mysqldump cacti > cacti.sql ( dump the DB you will be able to reimport it later)
4.) apt-get remove cacti && apt-get purge cacti ( this will uninstall caccti and purge all related files)
5.) install cacti via source you can use my script to help you https://github.com/bmfmancini/cacti-install-wizard
6.) re-import database mysql cacti < cacti.sql which will restore your settings
7.) copy the rra files to the new rra folder directory
again verify each step for errors I installed the package on 23.04 to test these instructions so yours may vary
Hello and thank you for your support @bmfmancini !
I will give it a try tomorrow using your procedure and script and let you know about how it worked.
Just a question upfront - since cacti still is running and polling. How would I stop the cacti poller without having access to the cacti website before so I can quietly backup the database?
you can either stop cron
systemctl stop cron
or remove the cacti file in /etc/cron.d/cacti
the wait for the file poll to finish
it would also be worth going to
console >> settings >> poller and disable data collection enabled this will disable the poller in the app as well
just ensure to flip it back on when you re-import the db
The last is not possible since I can not access the console because when I try to login it asks me to upgrade to version 1.2.10 immediately.
I have read that one can disable polling by changing the value in the database table "settings", named "poller_enabled" and set it to disabled.
It worked well so far and I finish up with the setup screen with Cacti Version 1.2.27.
I can begin with pre-installation checks whichj look good so far (just a few MySQL settings in orange).
Unfortunately the Installation Type / Upgrade screen comes with a warning - it looks like a downgrade from 1.2.29 to 1.2.27. In fact in your script I accepted to install the latest version.
What would you recommend?
Correction:
I changed the version in cacti_version to 1.2.29 and then I could login directly into cacti. It looks like it is working now (cacti v1.2.29 and spine v1.3.0).
I also had to re-build the poller and to change a number of paths to reflect the change of the installation to the /var/www/html/cacti/-Folder.
I could fix everything now. My cacti is up and running again.
Thank you @TheWitness and @bmfmancini for your support
Great!!!
Enjoy cacti!
I need to open this issue up again since I had to use the same procedure on a different instance of cacti on another server.
It looks like using the script of @bmfmancini went through well to the end but then I am unable to access the web console. Whether or not I do re-import the old cacti database or not - http://127.0.0.1/cacti only results in a 404 Error "Not Found" and "The requested URL was not found on this server."
The installation is in the default path /var/www/html/ and cacti/cacti for database and user.
However if I point the browser to http://127.0.0.1/html/cacti/ I get this:
Check your config.php make sure the base path is set to where you have cacti installed
The settings in the config.php file were correct.
However, I noticed that there was an issue with the cacti password setting in the old cacti mysql database which I did reload after running your setup procedure.
When I did set the password for the cacti user in mysql everything went as expected.
Now the system is well and running again.
I might ask you @bmfmancini again for another topic, since you are very knowledgable about Ubuntu and Cacti.
My headless PC is running Ubuntu 22.04.4 LTS and I am asked to upgrade to Ubuntu 24.04.1 LTS. Is this reasonable to do or are there things to be cautious about?
there should be no problems you of course should have a backup