Backing up and restoring WebSphere MQ

Periodically, you might want to take a backup copy of your queue manager data to protect against possible corruption caused by hardware failures. However, because message data is often short-lived, you might choose not to take backups.

Backing up WebSphere MQ

To take a backup copy of a queue manager's data:

  1. Ensure that the queue manager is not running. If you try to take a backup of a running queue manager, the backup might not be consistent because of updates in progress when the files were copied.

    If possible, stop your queue manager in an orderly way. Try executing endmqm -w (a wait shutdown); only if that fails, use endmqm -i (an immedIate shutdown).

  2. Find the directories under which the queue manager places its data and its log files, using the information in the configuration files. For more information about this, see Chapter 9, Configuring WebSphere MQ.
    Note:You might have some difficulty in understanding the names that appear in the directory. The names are transformed to ensure that they are compatible with the platform on which you are using WebSphere MQ. For more information about name transformations, see Understanding WebSphere MQ file names.
  3. Take copies of all the queue manager's data and log file directories, including all subdirectories.

    Make sure that you do not miss any files, especially the log control file and the configuration files. Some of the directories might be empty, but you need them all to restore the backup at a later date, so save them too.

  4. Preserve the ownerships of the files. For WebSphere MQ for UNIX systems, you can do this with the tar command. (If you have queues larger than 2 GB, you cannot use tar; for more information, see Enabling large queues.)

Restoring WebSphere MQ

To restore a backup of a queue manager's data:

  1. Ensure that the queue manager is not running.
  2. Find the directories under which the queue manager places its data and its log files. This information is held in the configuration file.
  3. Clear out the directories into which you are going to place the backed-up data.
  4. Copy the backed-up queue manager data and log files into the correct places.

Check the resulting directory structure to ensure that you have all the required directories.

See Appendix B, Directory structure (Windows systems) and Appendix C, Directory structure (UNIX systems) for more information about WebSphere MQ directories and subdirectories.

Make sure that you have a log control file as well as the log files. Also check that the WebSphere MQ and queue manager configuration files are consistent so that WebSphere MQ can look in the correct places for the restored data.

If the data was backed up and restored correctly, the queue manager will now start.

Note:Even though the queue manager data and log files are held in different directories, back up and restore the directories at the same time. If the queue manager data and log files have different ages, the queue manager is not in a valid state and will probably not start. If it does start, your data is likely to be corrupt.


© IBM Corporation 1994, 2002. All Rights Reserved