
Chapter 13: Backup and Recovery
A comprehensive backup strategy combined with properly tested recovery techniques enables your system and data as of the last backup to be recovered if there is a catastrophic failure. Each site will have specific issues concerning their provisioning system, the size of their database, available hardware, and available person hours, that they must address on a case-by-case basis. This chapter familiarizes you with the concepts supporting backup and recovery in InterMail. You can then apply these concepts in your specific backup and recovery environment. This is not a prescriptive, step-by-step method. This chapter includes these topics: Unforeseen disaster, hardware failure, data corruption, and operator error can severely impact your InterMail system. InterMail backup and recovery procedures address three types of disaster scenarios:
There are many considerations involved in backing up your InterMail system. What should you back up, and how often should backups occur? What strategies should you employ to make the most efficient use of your backup and recovery resources? Precise answers to these questions will depend upon a variety of factors including available hardware, message traffic, and any number of variables that are unique to your own InterMail installation. The frequency with which you back up your system should be determined by the specific characteristics of your installation (the amount of mail processed per day, the potential importance of a single message, the time required to execute a backup, etc.). You should review the standard practices established at your site for guidance in determining how often to back up the mail system. When backing up the InterMail files, it is recommended that you do the following: There are two types of backups in InterMail. These backups provide protection for messages stored in the MSS, account information contained in the Integrated Services Directory, and system configuration information in the Configuration Database: Complete Image Backups Complete image backups (copying the entire file system, or at least the InterMail portion) can only be carried out when the service is down, and should be performed during regularly scheduled maintenance windows and/or as opportunity allows when servers are down for other reasons. Frequency: Complete image backups should be made any time you change the software configuration of the InterMail host, including following the first installation of InterMail software. This is a fairly infrequent operation. Regular Mail System Backups The mail system must be backed up regularly. It is recommended that these backups be implemented in a maintenance window. Frequency: Mail system backups must be taken at least daily. The first step after a new or upgraded installation of InterMail should be to make a complete image backup of both the InterMail-specific file systems and the operating system file systems affected by the installation. This type of backup happens only infrequently but is important for recovery. During a complete restoration, this backup will provide the basis for applying the current working system. Complete image backups should take place whenever the system is in a quiescent state: the more recent the complete backup, the better. Immediately after an InterMail installation, no services have started. If you have started them manually or if this is an existing InterMail system, stop the services before taking the backup. The backup method employed to perform this operation is system- and configuration-dependent. You should at least copy the entire installation, all directories and files created as a part of InterMail, and any other files that changed as a result of the install, plus the system configuration files and user files. Following this process, you should have a complete image of the working system and the operating environment. At this point, with InterMail installed, the system can begin running and, if this is a fresh installation, should be ready for provisioning with new accounts. Permanent Mail Storage Data pertaining to mailboxes and messages is stored in the Message File System and the Message Store Database. The Message Store Database maintains tables of information that use pointers to allow designated mailboxes to access specific files in the Message File System. In addition, these tables keep track of the status of message files (e.g., which users have read and deleted them). Note that the actual message files (which contain the content of all messages) are stored separately in the Message File System. All message files are contained in the $INTERMAIL/msgfiles directory. Message Store Database files are located in the $INTERMAIL/db/mbox and $INTERMAIL/db/msgid directories. Temporary Mail Storage Messages in transit may be stored temporarily for a variety of reasons: the MSS or Integrated Services Directory Server may be unavailable, or a remote SMTP host may be down. In such situations, instead of handling messages in memory, the MTA stores the messages in its local spool directory. The spool directory on the MTA should be backed up periodically. Account Information As the sole source of directory information for InterMail, the Integrated Services Directory is an important component to back up on a regular basis. The frequency of backups depends on how fast the data in the Integrated Services Directory changes. If your site creates or modifies a large number of accounts, you should back up this data more often. Because the speed of recovering the system depends on the number of changes that have occurred since the previous backup, you should use recovery time as a factor in creating your backup schedule. The Directory Database data is contained in the following subdirectories under $INTERMAIL/db: entry index dircache System Configuration Information The configuration database, which contains values for all configuration options for each server, controls all InterMail components. This configuration data resides in a file named config.db in the $INTERMAIL/config directory. The Configuration Server manages the content of this database. It is extremely important that you back up the configuration information in the Configuration Database. Safe software practices dictate that you should back up the mail system on a regular basis. Follow the steps outlined below to take regular backups of your mail system. Restoration instructions are provided in the following section. The following instructions assume that you have installed InterMail in the default locations. If you selected other locations, you will need to adjust the instructions accordingly. imctrl drain allservers The drain method of shutdown allows the servers to be shut down without interrupting any current client connections. This is particularly useful for the POP and MTA servers, which are the most visible to end users. msgfiles db/mbox db/msgid db/entry db/index db/dircache mta/spool config/config.db imctrl restart allservers Restoring your mail system directories is a relatively easy process, provided you took the precaution of making regular backups. The instructions that follow assume the existence of the required backup files. Note that this recovery strategy will restore your system to its state as of the last backup. Any messages received and not read by users since the last backup will be lost. This is why it is important to do regular and frequent backups. If you have backed up the mail system files as instructed in the previous section, you should have copies of the following: Once you make sure that you have the required backup files, follow these instructions: imctrl drain allservers msgfiles db/mbox db/msgid db/entry db/index db/dircache mta/spool config/config.db imctrl restart allservers Graceful Recovery from System Crashes InterMail generates certain database log files that help ensure graceful recovery from machine crashes, server crashes, or ungraceful server shutdown. These log files are present under subdirectories in the $INTERMAIL/db directory. The log files are called log.NNNNNN where NNNNNN is some number. InterMail automatically uses these files when the system is restarted after a crash. These files are deleted automatically when they are no longer required for recovery.
13.1 Backing Up the Mail System
Note: No backup and recovery strategy can be considered effective until it has been fully tested under field conditions -it is necessary to conduct regular "fire drills" in a lab environment to ensure that the recovery strategy works.
13.1.1 Backup Considerations
13.2 Types of Backup
13.3 Complete Image Backup
Note: Whenever installing new software, you should back it up immediately. This type of backup should be part of your environment system backup strategy. The backup procedures presented here do not incorporate this type of file protection. If you have a highly customized installation, note your customized directories and be sure to back them up accordingly.
13.4 Mail System Backup
13.4.1 Backup Instructions
Note: Because client connections to the IMAP server are typically long-lived, the drain method is typically not practical for the IMAP server. Therefore, if you have an IMAP server running, you may use the stop shutdown option.
13.4.2 Recovery Instructions