Backup and Restore

Top  Previous  Next

 

QM does not provide any special backup and restore utilities but relies instead on use of standard operating system level backup tools. This section sets out some points to consider in planning a backup strategy. Hopefully, you have already thought of these...

Determine what to backup. If your backup needs to be as quick as possible, remember that it is usually unnecessary to back up system files that can easily be recreated.
Do not forget that distributed applications sometimes have critical data stored on client PCs. These need to be backed up at the same time as the server to preserve data integrity across the entire backup.
How often will you back up?  You need to make a sensible trade-off between the time it takes to backup and the difficulty of bringing the system up to date in the event of a restore.
Consider when to backup in relation to your business routine. It is unsafe to backup a database while it is being used except as described below. You will end up with data integrity problems and, possibly, structural integrity problems in files that were being modified while the backup progressed. The safest approach is to log all users off while the backup is performed. It is not necessary to shutdown QM.
Use a cycle of backup media rather than continuously overwriting the same media so that you are secure from failures during the backup and also have multiple points in time to which you can revert.
Ensure that your backup media is kept away from the system that it represents. A fireproof safe or an offsite store is best.
Think carefully about how long you will keep your backups. There are often legal requirements to be able to restore business data for several years. Remember that technology moves on at a rapid pace. You need to ensure that you still have the appropriate drives to read your old backups.
Test your backups. Check that you really can restore your data if the need arises.

 

 

Backup Tools

 

Although it would be possible to use the ACCOUNT.SAVE command to create a backup of a QM account, it is recommended that operating system level tools are used for this purpose. The account transfer tools and T.xxx commands do, however, have the advantage that they can be used to merge data with existing files.

 

Because individual records in hashed files cannot be accessed from outside of QM, operating system level backup tools can only save and restore an entire file. The T.DUMP command can take a select list specifying the records to be saved.

 

 

Live Backup

 

Sometimes there is no alternative to backing up a system while users are logged in. As mentioned above, simply copying the database files while they are being updated will almost certainly lead to inconsistent data, perhaps with structural problems that make restore impossible.

 

QM provides the ability to suspend database updates by use of  qm -suspend from the operating system command prompt. When this mode is in effect, applications will pause at any attempt to modify a file until updates are enabled using qm -resume.

 

Rather than pausing the database for the duration of a full backup, various mechanisms are available to minimise the time for which updates are suspended. If using mirrored disks, it would be possible to suspend updates, break the mirror, resume updates, backup the offline half of the mirrored data and then reconnect the mirror to catch up with changes during the backup.

 

Some environments provide snapshot backup systems where updates can be suspended, the snapshot initiated and updates resumed. The actual backup process performed by the snapshot will handle the complexities of database updates that occur during the backup.

 

Regardless of the technique used, beware that suspending updates will ensure structural integrity of the saved files but will not ensure business level data integrity as the suspension may occur part way through a series of related updates. Use of transaction programming techniques will help as the suspension will occur on committal of the transaction but it is still possible that a business level transaction is formed from multiple database transactions.