hi,
i tried to backup my cacti-server. so i use the mysqldump command and save my cacti.sql in another directory. then i killed my database (to test!) and follow the steps of the cacti-installation-manual again. after all i copy my saved cacti.sql back into my new directory and it seems to work. but i have only my localhost-graphs back, not my devices. old rra-files are there. what was my mistake? is there another file which includes all settings and has to be backup as well??
greetings from berlin
backup - question
Moderators: Developers, Moderators
-
- Posts: 24
- Joined: Mon Jul 24, 2006 9:11 am
- Location: Germany
- Contact:
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Hi
it sounds like you imported the cacti.sql file which ships with Cacti...
Can you drop / create the database again, and import the "right" cacti.sql ?
it sounds like you imported the cacti.sql file which ships with Cacti...
Can you drop / create the database again, and import the "right" cacti.sql ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
- kwabbernoot
- Cacti User
- Posts: 99
- Joined: Mon Oct 13, 2003 4:11 am
- Location: Zottegem, Belgium
Backup / Restore
Hi,
Could you please provide more details about your procedure ?
Does your cacti.sql dump file contain device information ?
Remark: the scripts/rrd files are not stored in the DB you need to back them up using tar or other means of file archiving
My Backup/Restore procedure works as follows:
@ Scheduled times
----------------------
- Dump of Cacti DB using WebMin MySQL Interface (using a WebMin DB Backup schedule)
- Tar/Gzip Cacti installation directory (using a cron job)
When restoring:
------------------
- Create a new MySQL DB that uses the same name of the old DB (when upgrading cacti the name is modified to the new version number)
- Import of the .sql cacti DB dump (using WebMin MySQL Interface)
- Creation of the MySQL cacti DB user, activation of permissions on DB
- Restore cacti.tar.gz into the webroot
- Reset user permissions to cacti user on <path_cacti>/cacti/rra and /log file if needed
- Configuration of cacti Web space in apache
- Start using Cacti
Regards,
Kwabbernoot
Could you please provide more details about your procedure ?
Does your cacti.sql dump file contain device information ?
Remark: the scripts/rrd files are not stored in the DB you need to back them up using tar or other means of file archiving
My Backup/Restore procedure works as follows:
@ Scheduled times
----------------------
- Dump of Cacti DB using WebMin MySQL Interface (using a WebMin DB Backup schedule)
- Tar/Gzip Cacti installation directory (using a cron job)
When restoring:
------------------
- Create a new MySQL DB that uses the same name of the old DB (when upgrading cacti the name is modified to the new version number)
- Import of the .sql cacti DB dump (using WebMin MySQL Interface)
- Creation of the MySQL cacti DB user, activation of permissions on DB
- Restore cacti.tar.gz into the webroot
- Reset user permissions to cacti user on <path_cacti>/cacti/rra and /log file if needed
- Configuration of cacti Web space in apache
- Start using Cacti
Regards,
Kwabbernoot
-
- Posts: 24
- Joined: Mon Jul 24, 2006 9:11 am
- Location: Germany
- Contact:
hi,
i did it again and think it works.
my steps:
- mysqldump -u root cacti > backup.sql
- copy of the whole directory elsewhere
- killed the DB (mysql> drop database cacti;) and delete directory of cacti
- copy saved directory to my /www/html/
- copy saved backup.sql to cacti.sql in /var/html/cacti
- cacti-installation-steps
- mysqladmin --user=root create cacti
- mysql cacti < cacti.sql
- mysql> Grant al on cacti.* to ....;
- mysql> flush privileges;
and that was all.
after opening my webbrowser and logging in, i had my graphs and devices back and they go on with graphing as well.
now i have to look for a script to backup .sql anddirectory in a peridically way and not manual.
are these steps ok? i' am open for any suggestions
i did it again and think it works.
my steps:
- mysqldump -u root cacti > backup.sql
- copy of the whole directory elsewhere
- killed the DB (mysql> drop database cacti;) and delete directory of cacti
- copy saved directory to my /www/html/
- copy saved backup.sql to cacti.sql in /var/html/cacti
- cacti-installation-steps
- mysqladmin --user=root create cacti
- mysql cacti < cacti.sql
- mysql> Grant al on cacti.* to ....;
- mysql> flush privileges;
and that was all.
after opening my webbrowser and logging in, i had my graphs and devices back and they go on with graphing as well.
now i have to look for a script to backup .sql anddirectory in a peridically way and not manual.
are these steps ok? i' am open for any suggestions
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
I'm using this script to dump the Cacti database :tecker2010 wrote:now i have to look for a script to backup .sql anddirectory in a peridically way and not manual.
are these steps ok? i' am open for any suggestions
Code: Select all
$ cat dump_mysql_cacti.sh
YEAR=`date +%Y`
MONTH=`date +%m`
DAY=`date +%d`
echo "Dump of $DAY-$MONTH-$YEAR"
mkdir -p /cacti/dumps_mysql/$YEAR/$MONTH > /dev/null 2>&1
mysqldump -u root --password=xxxx cacti > /cacti/dumps_mysql/$YEAR/$MONTH/cacti-$DAY-$1.dmp
bzip2 /cacti/dumps_mysql/$YEAR/$MONTH/cacti-$DAY-$1.dmp
RRD files are backuped with Veritas NetBackup.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
-
- Posts: 24
- Joined: Mon Jul 24, 2006 9:11 am
- Location: Germany
- Contact:
thanks, but i tried another script and it works
--> http://forums.cacti.net/about12749.html
but with #!/bin/sh instead of #!/bin/bash
with bash i get the error 'bash: configure : /bin/sh^M: bad interpreter: no such file or directory', but no idea why. the main thing is that the backup works
--> http://forums.cacti.net/about12749.html
but with #!/bin/sh instead of #!/bin/bash
with bash i get the error 'bash: configure : /bin/sh^M: bad interpreter: no such file or directory', but no idea why. the main thing is that the backup works
Who is online
Users browsing this forum: No registered users and 3 guests