Time for action – backup your Cacti database
Logon to your Cacti system.
Execute the following command to create a backup directory:
mkdir /backup
Execute the following command and replace <password> with your MySQL database password (all in one line):
mysqldump --user=root --password=<password> --add-drop-table --databases cacti > /backup/cacti_database_backup.sql
Verify that the backup file was created by issuing the following command:
ls -l /backup
Look at the file with the
more
command:more /backup/cacti_database_backup.sql
What just happened?
You just created a backup of your Cacti database which includes everything that is stored in your Cacti database, from user IDs to graph templates, and all the hosts added to your instance.
Although you now have a backup of your database, you don't have a backup of the actual database user. You will need to remember to create a database user for Cacti when restoring it to a freshly installed system.