Pandora: Documentation en: Backup and restore procedures
- 1 Backup procedure
- 2 Restore procedure
- 2.1 Install the appliance
- 2.2 Database restore
- 2.3 Configuration file restore
- 2.4 Agent restore
- 2.5 Server restore
- 2.6 Console restore
- 2.7 Starting Pandora FMS server and agent
1 Backup procedure
The purpose of this document is to illustrate the Pandora FMS appliance backup and restore procedures.
1.2 Database backup
Firstly, make a backup of the existing database. There are two methods available to make such backup.
1.2.1 Manual backup
mysqldump -u <pandora_db_user> -p <pandora_db_name> | gzip > pandoradb.sql.gz <enter the password in console>
1.2.2 Pandora FMS Database Backup utility
In the extension manager menu the Backup section is found, where the following window will appear.
The backups made with that tool can be filtered by directory in here and a new backup of the database can be created:
- with a description
- In the desired directory. In /var/www/html/pandora_console/attachment/backups by default.
1.3 Configuration files backup
In order to backup Pandora FMS's agents and server configuration files, type in:
tar -pcvzf pandora_configuration.tar.gz /etc/pandora/*.conf
1.4 Agent backup
The agent folder must also be backed-up. This is very important to keep deployed collections and agent plugins.
tar -pcvzf agent.tar.gz /usr/share/pandora_agent
1.5 Server backup
1.5.1 Server plugins
Server plugin default folder is under /usr/share/pandora_server (the main Pandora FMS's server folder).
Caution: If you have server plugins placed in other folders, back them up as well.
tar -pcvzf pandora_server.tar.gz /usr/share/pandora_server tar -pcvzf my_plugin_folder.tar.gz /home/myuser/my_plugin_folder
1.5.2 Remote configuration
Remote configuration file and collection backup must be performed in order to keep the remote agent's usual performance
tar -pcvzf collections.tar.gz /var/spool/pandora/data_in/collections tar -pcvzf md5.tar.gz /var/spool/pandora/data_in/md5 tar -pcvzf remote_agents_conf.tar.gz /var/spool/pandora/data_in/conf
1.6 Console backup
Later on, perform a console backup, to keep custom images, extensions, and more.
tar -pcvzf pandora_console.tar.gz /var/www/html/pandora_console
2 Restore procedure
2.1 Install the appliance
Insert the CD in your system and press a key in the boot screen. The boot menu will be displayed then. The Appliance can be found in the download section.
If you select "Install" (Text mode), the installation will be performed in text mode. However, if the Install option is selected, the graphical installation will start (recommended). Choose between one of these two options, and reboot the machine after the installation.
2.2 Database restore
2.2.1 Manual restore
Make sure that your database is up and running, and the Pandora FMS's server and agent are shut down.
[[email protected] ~]# /etc/init.d/mysqld start Starting mysqld: [ OK ] [[email protected] ~]# /etc/init.d/pandora_server stop Stopping Pandora FMS Server [[email protected] ~]# /etc/init.d/pandora_agent_daemon stop Stopping Pandora Agent.
Then, restore the database
[[email protected] ~]# gunzip pandora.sql.gz [[email protected] ~]# cat pandoradb.sql | mysql -u root -p pandora Enter password: <enter the password in console>
Additionally, the recovery can be performed in the following way.
mysql –u root –p pandora create database pandora; use pandora; source PATH BACKUP;
2.2.2 Recovery through Pandora FMS Database Backup utility
In order to restore a backup, go to the backup to be recovered from the backup list and click on the 'Rollback to this backup' option. Later you will receive a message to the console with the steps to restore the selected database manually.
2.3 Configuration file restore
First, restore agent and server configuration files:
[[email protected] ~]# tar -zxvf pandora_configuration.tar.gz -C /
2.4 Agent restore
Now, restore the agent directory.
[[email protected] ~]# tar -zxvf agent.tar.gz -C /
2.5 Server restore
2.5.1 Server plugins
Restore the Pandora FMS server main folder, and every other plugin folder that you may have.
[[email protected] ~]# tar -zxvf pandora_server.tar.gz -C / [[email protected] ~]# tar -zxvf my_plugin_folder.tar.gz -C /
2.5.2 Remote configuration
Remote configuration file and collection restore must be performed in order to keep the remote agent's usual performance.
[[email protected] ~]# tar -zxvf collections.tar.gz -C / [[email protected] ~]# tar -zxvf md5.tar.gz -C / [[email protected] ~]# tar -zxvf remote_agents_conf.tar.gz -C /
2.6 Console restore
Next, restore the console to keep your custom images, extensions, and more.
[[email protected] ~]# tar -zxvf pandora_console.tar.gz -C /
2.7 Starting Pandora FMS server and agent
The last step is to start the Pandora FMS server, and agent.
[[email protected] ~]# /etc/init.d/pandora_server start [[email protected] ~]# /etc/init.d/pandora_agent_daemon start