Backup Overview

Regular, reliable backups are an important part of protecting your Khaos Control system and helping you recover if data is lost, damaged or needs to be restored.

Khaos Control includes a database backup option in the File menu.

This article explains what you should include in your backups, how the built-in database backup works, and some options for automating the process.
Important: You are responsible for selecting, implementing, monitoring and testing a backup strategy that meets your organisation's requirements. We recommend working with your IT specialist to make sure your database and all dependent files are backed up safely and regularly.
For the Khaos Control database, our recommended approach is to use dedicated backup software that can back up a Microsoft SQL Server database while it remains mounted.

With this type of solution in place, you should not normally need to rely on the Khaos Control File > Backup Database command as your primary backup method.
Your backup strategy should cover:
  • The live Khaos Control database.
  • Khaos Control configuration and other ancillary files.
  • Files used by integrations or third-party applications.
  • Secure copies held separately from the live server.
  • Regular monitoring to confirm that backups have completed successfully.
  • Regular restore testing to confirm that your backups can actually be recovered.

Creating a database backup from Khaos Control

Although it is not strictly necessary, we recommend taking a manual backup when users are logged out of Khaos Control wherever practical.
To create a backup:
  1. Open File.
  2. Select Backup Database.
  3. Allow the backup to complete.
The backup is created on the server in the Databak directory. For example:
D:\KhaosControl\KhaosData\Databak\Khaos0.bak
Khaos Control cycles through four backup files:
  • Khaos0.bak
  • Khaos1.bak
  • Khaos2.bak
  • Khaos3.bak
Do not rely on these files remaining on the live server as your only backups. Copy them to appropriate backup storage and keep a secure, accessible copy off-site.

How long will a backup take?

The time needed to create a database backup varies between systems. Factors include:
  • Server processor performance.
  • Available memory.
  • Disk performance.
  • Database size and number of records.
  • Other applications running on the server.
  • Network performance if the backup is started from a workstation.

Full and incremental backups

Your IT specialist may configure Microsoft SQL Server to take incremental backups as part of your wider backup strategy.
Incremental backups can reduce how much data would need to be re-entered following a recovery because backups can be taken more frequently during the day.
A recovery using incremental backups normally requires the last full backup followed by the subsequent incremental backups in the correct chronological order.
Your IT specialist should design, implement and test this process for your SQL Server environment.

Testing environments and CopyLive2Test

Some customers have a Testing environment together with the CopyLive2Test facility.
CopyLive2Test backs up the live KHAOS database and restores it into the KHAOS_TESTING environment, overwriting the database currently held in Testing.
The backup created by CopyLive2Test is normally placed in the live system's Databak directory as:
KHAOS.bak
Important: Because CopyLive2Test overwrites the existing Testing database, make sure you understand the effect before running it.

Backing up ancillary files

A complete backup strategy should not cover only the database. Khaos Control can depend on configuration files and other resources stored outside the SQL database.
Depending on your installation, these may be held in directories such as:
  • D:\KhaosControl
  • D:\SharedApps\KeystoneSoftware
  • D:\SharedApps\KeystoneSoftwareTESTING
  • D:\SharedApps\KeystoneSoftwareUTILS
You should also consider any third-party applications used alongside Khaos Control, such as software supplied by your couriers.

Common files stored outside the database

Examples include, but are not limited to:
  • Khaos Control report design and template files (*.rtm).
  • Payment integration settings.
  • Web and HHT integration configuration files.
  • Khaos Control command-line scripts and batch files.
  • Windows scheduled tasks.
  • Third-party courier configuration files.
  • External logos or images used for products or reports.
Review your external files regularly, particularly after deployment or configuration changes. Your backup strategy should contain everything required to restore your Khaos Control environment to working order.

Automating database backups

Automated SQL Server backups can form part of your backup strategy.
For example, your IT specialist may configure Microsoft SQL Server to create a database backup automatically each day. The resulting backup file can then be included in your normal overnight backup process.
The exact configuration depends on the version and installation of SQL Server you use. Your IT specialist should therefore configure and test any automated solution rather than relying on a generic script.

Legacy SQL Server backup script

Older installations may have used a Windows batch file, such as:
D:\KhaosControl\khaosbackup.bat
The following is a legacy example supplied for Microsoft SQL Server 2005 and 2008:

@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
​
Important: This is a legacy example for SQL Server 2005 and 2008. Do not copy it directly into a current production environment without having your IT specialist review and adapt it for your installation.

On older systems, a scheduled Windows task may have been configured to run the batch file before the overnight backup.
The account running the scheduled task must have sufficient permissions to back up the Khaos Control database. If that account's password changes, the scheduled task may also need to be updated. Otherwise, the backup may fail to start.

Monitoring your backups

Do not assume an automated backup has succeeded simply because it is scheduled.
Check your backup process regularly for errors and make sure someone is responsible for investigating failed backups.
For legacy scheduled processes, this may include checking the system's application log each morning to confirm that the scheduled task completed successfully.

Testing your backups

A backup is only useful if it can be successfully restored.
Test your backup and recovery process:
  • During the testing and implementation phase of your Khaos Control project.
  • After significant changes to your backup configuration.
  • At least once a year as part of your ongoing backup checks.
Where possible, test restoration to another machine or suitable non-live environment. This helps confirm that the database, configuration and other required files are all available and usable.

Restoring the database

Warning: Do not attempt to restore a database backup over your LIVE Khaos Control system without assistance.
Restoring a live database can overwrite current business data and should be carefully controlled.
If you need to restore your LIVE database, email Khaos Control Support for assistance before proceeding.

See Also


Did you find this article helpful?