Backup Overview


Creating backup copies of the Khaos Control database

Executive Summary

Whilst we can inform clients of various backup strategies and processes that have been used elsewhere, each of our clients is responsible for selecting, implementing, monitoring and testing their own backup strategy.

Khaos Control Database

In respect of Khaos Control's database, our official recommendation is to get proper backup software that is capable of backing up a SQL server database while it is still mounted, so negating the need to use Khaos Control's [ File | Backup Database ] command entirely.

External Files

In addition to taking regular copies of the database, you should also keep up-to-date copies of Khaos Control's configuration files (e.g. directory structures with names like 'D:\KhaosControl', 'D:\SharedApps\KeystoneSoftware', 'D:\SharedApps\KeystoneSoftwareTESTING', 'D:\SharedApps\KeystoneSoftwareUTILS') and any other third-party software you use with Khaos Control (e.g. supplied by your couriers). Please see the Anciliary files section below for further information.

WARNING icon
WARNING: Khaos Control licensees, in conjunction with their IT specialists, should ensure that system databases and dependant files are backed-up in a safe and regular pattern (please refer to your Software License for more information).

Discussion

If you have backed up your system regularly (e.g. at close of business every day) and can access your backups (i.e. you have kept them in a secure and accessible place off-site), then it should be possible to restore your system to the same condition it was in when the backup was made.

Although not strictly necessary, we suggest that backups be taken when users are logged out of the Khaos Control system. Creating a full database backup file on the server's hard disk is a quick and straightforward operation - simply select the [ File | Backup Database ] menu route.

Obviously the time taken to create the backup will depend on a whole range of factors including the server's performance (e.g. processor speed, amount of memory installed, disk access times), the number of records in the database, what other programs are running on the server at the same time and what the network speed is (if backup initiated from a workstation).

Once the backup file has been created on the server, we suggest this be copied to some form of offline storage (e.g. tape, CD ROM, memory disk) and retained in secure and accessible off-site storage.

If you need to revert to backup at some point and do not want to have to re-key everything entered since last night, it is possible to configure SQL server to perform incremental backups, rather than full system backups every time (whoever provides your IT support should be able to arrange this for you). Taking an incremental backup is notably quicker and therefore probably quite able to be done on a rolling basis throughout the day. Restoring from an incremental backup involves restoring your last full backup and then each incremental backup (taken since the full backup) in strict chronological order. You will then only have to re-key a smaller amount of data to get to the position you were in before you decided to revert to backup.

Suggested Backup Process

Whilst we can inform clients of various backup strategies and processes that have been used elsewhere, each of our clients is responsible for selecting, implementing, monitoring and testing their own backup strategy.

Database Backups

To create a backup of your database from within Khaos Control, please run the [ File | Backup Database ] command. This copies your database to a backup file in the databak directory (e.g. 'D:\KhaosControl\KhaosData\Databak\Khaos0.bak'). The system uses a cycle of four backup files ('khaos0.bak', 'khaos1.bak', 'khaos2.bak', and 'khaos3.bak') and we suggest you copy these files to tape (or other removable media) and keep them safe.

Some clients have a Testing environment installed, together with a CopyLive2Test facility that backs up the live KHAOS database and restores it to the KHAOS_TESTING environment (overwriting the existing Testing database). The backup created by CopyLive2Test is normally written to the live system's databak directory with a filename of 'KHAOS.bak'.

Anciliary File Backups

In addition to taking regular copies of the database, you should also keep up-to-date copies of Khaos Control's configuration files (e.g. directory structures with names like 'D:\KhaosControl', 'D:\SharedApps\KeystoneSoftware', 'D:\SharedApps\KeystoneSoftwareTESTING', 'D:\SharedApps\KeystoneSoftwareUTILS') and any other third-party software you use with Khaos Control (e.g. supplied by your couriers).

Types of common files which are external to the Khaos Control database can include (but not limited to) :

  • Khaos Control Report design/template files (*.rtm)
  • Khaos Control Payment Integration settings
  • Khaos Control web / hht integration configuration files
  • Khaos Control command line scripts/batch files and scheduled tasks.
  • 3rd Party Courier configuration files
  • External logos or images used by Khaos Control, for products and/or reports.

We recommend assessing your usage of external files regularly, and after any deployment changes to ensure your backup strategy covers all external files needed to restore your system to working order.

An Automated Database Backup Process

A number of clients whose systems are running on Microsoft SQL Server simply create a backup file of their Khaos Control database on a daily basis and include this file with their routine nightly backup to tape, etc.

There are several ways of doing this; for example, SQL Server Standard has a Job Scheduler that can be used to schedule backups directly from the SQL Server Management Studio. But how this works is subtly different on all versions and installations, and clients should always seek advice from their IT Support Specialist before implementing an automated backup solution.

For the technically-minded, another way of doing this might be to create a batch file (with a name like D:\KhaosControl\khaosbackup.bat) having contents of the form:

@echo off
set BaseDir=D:\KhaosControl\
set BackDir=%BaseDir%KhaosData\Databak\
set DbName=KHAOS

@echo.|Command /C Date>%TEMP%\DoW
set /p today=<%TEMP%\DoW
set DoW=%today:~16,3%

if "%DoW%=="Sun" set weekDAY=Sunday
if "%DoW%=="Mon" set weekDAY=Monday
if "%DoW%=="Tue" set weekDAY=Tuesday
if "%DoW%=="Wed" set weekDAY=Wednesday
if "%DoW%=="Thu" set weekDAY=Thursday
if "%DoW%=="Fri" set weekDAY=Friday
if "%DoW%=="Sat" set weekDAY=Saturday

@echo on
@echo sqlcmd -S localhost -E -Q "backup database KHAOS to disk = '%BaseDir%Databak\%DbName%_%weekDAY%.bak' with init">%BackDir%%DbName%_%weekDAY%.log 2>&1
sqlcmd -S localhost -E -Q "backup database KHAOS to disk = '%BackDir%%DbName%_%weekDAY%.bak' with init">>%BackDir%%DbName%_%weekDAY%.log 2>&1

This example uses commands compatible with Microsoft SQL Server 2005 & 2008 to backup a database called 'KHAOS' to a file of the form '<dayname>.log' in the directory 'KhaosControl\KhaosData\Databak' (your IT Support Specialist should change the destination directory and filename to suit your requirements).

Your IT Support Specialist may choose to add a new task to the server's schedule (using Windows [ Start | All Programs | Accessories | System Tasks | Scheduled Task ] to run the task wizard) that runs the batch file 'D:\KhaosControl\khaos_backup.bat' at an appropriate time (e.g. to complete before the overnight backup to tape run). Be sure that the task is running in a valid context (e.g. with a username that has sufficient rights to backup the Khaos Control database on your MS SQL Server). Be sure to update the scheduled task should the selected user's password change, otherwise the task will not be able to start and your backup will fail!


INFORMATION icon
It is good practice to check the system's application log every morning to ensure the task ran without error.


INFORMATION icon
We also suggest testing your backup during the testing & implementation phase of your project and subsequently at least once a year, to ensure it can be successfully restored to another machine.

Restoring the database

Do not attempt to restore a backup file over your LIVE system without seeking assistance, please email Support.

Notes

See Also


Did you find this article helpful?