Database and Backup

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
_Chris_
Posts: 42
Joined: Mon Oct 17, 2005 8:56 am

Database and Backup

Post by _Chris_ »

Hello,

I was just wondering how I can backup my cacti installation and how is the database stuctured?

What are the critical files to backup?

And what can I do with just my rrd files? Are they useless alone?

Thanks in advance for your help,


CHris
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

This is covered in the Upgrade guide.
_Chris_
Posts: 42
Joined: Mon Oct 17, 2005 8:56 am

Post by _Chris_ »

OK thanks.

Chris.
_Chris_
Posts: 42
Joined: Mon Oct 17, 2005 8:56 am

Post by _Chris_ »

Hello BSOD2600,

I have just backed up a previous Cacti installation and encountered a problem.

I followed the installation guide, and when getting on the cacti webpage for the first time, seeing the "installation guide" page, I followed your advice on how to upgrade a cacti installation.

I have copied the rra folder in the new cacti installation, had no scripts to copy. I then went back to the webpage of cacti, selected the upgrade option instead of the new install and got the following message:

"Error

Invalid Cacti version new_install, cannot upgrade to 0.8.6g"

Is it because evenetually I am not "really" upgrading cacti but just backing it up? What should I do then?

I then clicked on new install and after changing the password, I had the following message:

"Error

upgrades, this installation is already up-to-date. Click here to use Cacti."

And my rrd files, devices were not included in Cacti. I guess it's coming from the fact that I did not put the database back in cacti (the mysql.cacti). What is the command line to put it back?

PLEASE HELP! ;o)

Thanks in advance for your help,


Chris
_Chris_
Posts: 42
Joined: Mon Oct 17, 2005 8:56 am

Post by _Chris_ »

Well, looking at your installation guide where there is:

4.) Import the default Cacti database:

shell> mysql --user=root --password cacti < c:\apache2\htdocs\cacti\cacti.sql

I thought that I'd replace the "c:\apache2\htdocs\cacti\cacti.sql" by the mysql.cacti and apparently it worked :o)==)

I have my graphs back and my devices back.

It is ok or should I type some other commande lines to have the entire database back?

Thanks in advance for your help,

Chris
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

My upgrade methods are slightly different than what the upgrade guide states.

1) stop the cacti scheduled task.
2) Run the weekly backup job for cacti (regardless if its been a week or not). This backs up the entire cacti folder plus the MySQL cacti data files.
3) Overwrite all the older cacti files with the new ones.
4) Navigate to my cacti website and do the upgrade.

Thats been working since cacti 0.8.5 for me.


As for your method... yea, I guess that would work since all you're doing is just re-importing your mysql database which I assumed you previously exported few steps prior.
_Chris_
Posts: 42
Joined: Mon Oct 17, 2005 8:56 am

Post by _Chris_ »

Hello,

Thanks for your reply, but I still have some questions:

"2) Run the weekly backup job for cacti (regardless if its been a week or not). This backs up the entire cacti folder plus the MySQL cacti data files."

What is the weekly backup job? Is it a batch using the command lines given in your manual to backup the cacti folder and the mysql cacti data files?

"4) Navigate to my cacti website and do the upgrade."

How could I navigate to "your" cacti website and do the upgrade? Won't I get the same error messages that I got previously?

"As for your method... yea, I guess that would work since all you're doing is just re-importing your mysql database which I assumed you previously exported few steps prior."

Ok so would that work on a upgrade? Or just an a re-installation of Cacti?

And can I copy the rra folder plus re-importaing the mysql database and then use the upgrade option on the cacti webpage for an upgrade of a cacti installation?

Because in your guide, you ask to backup the mysql database, but then you don't tell us when to restore it. Is this normal? Or is it in the process of the upgrade with the cacti webpage that they ask you to restore the mysql file?

I am making a manual on how to install cacti, and as told previously, after copying the rra folder, I forgot to restore the mysql database and got two errors when trying to upgrade or to do a new install. If I had copied the rra folder and restore the database before trying to access the first cacti webpage, would that have made any difference?

Thanks in advance for your help,

Chris
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) The weekly backup job, is a scheduled task I created using the windows backup tool.

2) To navigate to my website, I mean by going to http://localhost/cacti/ and following the update instructions.

3) The reimporting of the mysql database might work, but it's really not needed for an upgrade. You might have other consistancy issues with yours. Have you checked it (the mysql database) for errors?

4) No, I didn't leave out the restore portion in my guide. I simply backup the cacti files / database in case the upgrade goes bad. That way I have something functional to roll back to. Since I'm doing an in-place install/overwrite of the existing cacti files, all my old stuff is still there.
_Chris_
Posts: 42
Joined: Mon Oct 17, 2005 8:56 am

Post by _Chris_ »

Hi,

Sorry but I am not sure I understand everything.

So you overwrite all your cacti files and THEN go on the upgrade page and update your cacti version?

But by overwriting your new files with the old ones, won't there be any problems?

Your method would work if you are onyl modifying cacti and not your MySQL database, and because you do it on the same computer.

But what if I install Cacti on a new computer from a previous installation... How do you import the MySQL database but with the command line I gave you previously? Because with only your cacti files, there is no way your new installation will work...

As I said before I could not get the upgrade to work with this new cacti installation and I did it "MANUALLY". But what do you get if you can load the cacti upgrade page? IS there any option to export the MySQL database?

Thanks in advance for your help,

Chris
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

_Chris_ wrote:So you overwrite all your cacti files and THEN go on the upgrade page and update your cacti version?
Yes.
_Chris_ wrote:But by overwriting your new files with the old ones, won't there be any problems?
I'm overwriting the old cacti files with the new ones. If there are any problems, I can restore my backup I just made before doing the upgrade.
_Chris_ wrote:Your method would work if you are onyl modifying cacti and not your MySQL database, and because you do it on the same computer.
Right.
_Chris_ wrote:But what if I install Cacti on a new computer from a previous installation... How do you import the MySQL database but with the command line I gave you previously? Because with only your cacti files, there is no way your new installation will work...
Right. You would also need to import your old cacti mysql database.
_Chris_ wrote: IS there any option to export the MySQL database?
No. You must do this manually with the mysql client.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests