Backup and Restore This page reviews GroundWork Monitor backup and restore processes. Backup and Restore Processes This page presents the backup and restore processes for the Foundation database, JBoss framework, GroundWork Insight Reports, and Configuration (monarch). The operational databases used by GroundWork Monitor are GWCollageDB (Foundation) which contains state and event data, and the Dashboard database which contains historical information used by Insight and Availability Reports. Foundation Database (gwcollagedb) This section covers backing up and restoring the Foundation database. Additionally, steps to delete the entire GWCollageDB database and reset the initial settings. Backup the Foundation Database You can manually backup the GWCollageDB database at a command line with the following steps: Issue the following command to create a backup sql file. You will be prompted for a password for the user. In the example below, gwcollagedb_backup_09012009.sql is the database backup file name where 09012009 is the current date. pg_dump -f /usr/local/groundwork/backup/gwcollagedb-1117201sql.tar -F t -c -E LATIN1 gwcollagedb Next, restart gwservices with the following command: Restore the Foundation Database To restore a database that was previously backed up, use the following procedure. Change the directory to the foundation/backup with the following command: cd /usr/local/groundwork/foundation/backup You should see a file with the name: gwcollagedb_backup_<timestamp>.sql.tar Restore the old database by entering the following command at the Operating System prompt:
pg_restore -d gwcollagedb -F t -c /usr/local/groundwork/backup/gwcollagedb_backup_<timestamp>.sql.tar Delete and Reset the Foundation Database To delete the entire GWCollageDB database and reset the initial settings, use the following procedure. Set the environment variables for the shell. source /usr/local/groundwork/scripts/setenv.sh Change the directory with the following command. This directory has all the database create SQL statements. cd /usr/local/groundwork/core/databases/ql Drop and re-create the current GWCollageDB database by executing the following script: "create-fresh-gwcollagedb.sql" Load the content of GWCollageDB.sql into GWCollageDB database with the following command: "GWCollageDB.sql" Load all the seed scripts: "/usr/local/groundwork/core/databases/ql/-xtra-functions.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/gwcollage-console.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/gwcollage-console.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/gwcollage-metadata.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/gwcollage-state.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/gwcollage-version.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/gwcollage-performancelabeldata.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/foundation-base-data.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/nagios-properties.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/system-properties.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/snmp-properties.sql" gwcollagedb "/usr/local/groundwork/core/databases/ql/syslog-seed.sql" gwcollagedb
8. JBoss Databases The JBoss Portal databases contain information for system users, roles, applications and permissions. Backup the JBoss Databases You can manually backup the JBoss databases at a command line with the following steps: Issue the following command to create a backup sql file. You will be prompted for a password for the user. In the example below, jbossdb_backup_09012009.sql is the database backup file name where 09012009 is the current date. pg_dump -f /usr/local/groundwork/backup/jbossportal_backup_09012009.sql.tar -F t -c -E LATIN1 jbossportal pg_dump -f /usr/local/groundwork/backup/jbossdb_backup_09012009.sql.tar -F t -c -E LATIN1 jbossdb To restart gwservices enter the following command: Restore the JBoss Database Make sure no one is logged into the system stopping gwservices with the command: Change the directory to backup/jboss with the following command: cd /usr/local/groundwork/backup/jboss
You should see a file with the name: jbossportal_backup_<timestamp>.sql jbossdb_backup_<timestamp>.sql Drop and recreate the current JBoss databases with the following script: "create-fresh-jbossdb.sql" Restore the old database by entering the following commands at the Operating System prompt: pg_restore -d jbossportal -F t -c jbossportal_backup_<timestamp>.sql.tar pg_restore -d jbossdb -F t -c jbossdb_backup_<timestamp>.sql.tar 8. 9. Insight Reports Database (dashboard) This section covers backing up and restoring the Insight Reports database. Additionally, steps to delete the entire dashboard database and reset the initial settings. Backup the Insight Reports Database You can manually backup the dashboard database at a command line with the following steps: Issue the following command to create a backup sql file. You will be prompted for a password for the user. In the example below, dashboard_backup_09012009.sql is the database backup file name where 09012009 is the current date. pg_dump -f /usr/local/groundwork/dashboard/backup/dashboard_backup_09012009.sql.tar -F t -c -E LATIN1 dashboard
Restore the Insight Reports Database To restore a database that was previously backed up, use the following procedure. Change the directory with the following command: cd /usr/local/groundwork/dashboard/backup Restore the old database by entering the following command at the Operating System prompt: pg_restore -d dashboard -F t -c dashboard_backup_<timestamp>.sql.tar Delete and Reset the Insight Reports Database To delete entire dashboard database and reset the initial settings, use the following procedure. Change the directory with the following command. This directory has all the database create SQL statements. cd /usr/local/groundwork/core/databases Drop and re-create the current dashboard database by executing the following script: "create-fresh-dashboard.sql" Load the content of dashboard_nagios_create.sql into the dashboard database with the following command:
"/usr/local/groundwork/core/databases/ql/dashboard-db.sql" dashboard 8. Configuration Database (monarch) This section covers backing up and restoring the Monarch database from the user interface, a command line. Backup from the User Interface You have the option to backup the Configuration database via the interface every time a Commit is executed. When you enter the Control> Commit option from the Configuration navigation screen, you will be presented with the options to Abort, Backup or Commit. Selecting the Backup option will create a backup of the Monarch database and Nagios configuration files in the /usr/local/groundwork/core/monarch/backup directory. After the backup completion message is shown, you can select Abort if you do not want to follow through with a Commit. Backup from a Command Line You can manually backup the monarch database at a command line with the following steps: Stopping the Nagios deamon with the command: /usr/local/groundwork/ctlscript.sh stop nagios Deleting temporary session files with the commands: rm -rf /tmp/sess* rm -rf /tmp/tpl* Issue the following command to create a backup sql file. You will be prompted for a password for the user. In the example below, monarch_backup_09012009.sql is the database backup file name where 09012009 is the current date. pg_dump -f /usr/local/groundwork/core/monarch/backup/monarch_backup_09012009.sql.tar -F t -c -E LATIN1 monarch
Restart Nagios with the following command: /usr/local/groundwork/ctlscript.sh start nagios Restore the Configuration Database Stopping the Nagios deamon with the command: /usr/local/groundwork/ctlscript.sh stop nagios Deleting temporary session files with the commands: rm -rf /tmp/sess* rm -rf /tmp/tpl* Change the directory to: cd /usr/local/groundwork/core/monarch/backup You should see a file with the name: monarch_backup_<_timestamp_>.sql Restore the old database by entering the following command at the system prompt: pg_restore -d monarch F t -c monarch_backup_<timestamp>.sql.tar 8. Restart Nagios with the following command:
8. /usr/local/groundwork/ctlscript.sh start nagios 9. 10. Next, to view and confirm the restored configuration, use the web interface to commit the restored monarch database: Configuration> Control> Pre flight test. And then, Commit> Backup> Commit.