Backing up a queue manager

You can use the command line to back up a queue manager to an archive file on the appliance.

About this task

You connect to the IBM® MQ Appliance by using the command line, and save the queue manager to a file. The queue manager configuration is saved, together with log files and queue data.

Before you back up your first queue manager, you must create the target directory for backup files, and allocate storage for it in the appliance RAID volume. If you are backing up a queue manager that has an encrypted file space, you should specify that the space allocated is encrypted. Otherwise your back up will not be encrypted.

A backup of a high availability (HA) queue manager does not contain any HA configuration data, so if you restore the queue manager from a backup file it is restored as a stand-alone queue manager. Similarly, disaster recovery (DR) configuration data is not preserved when you back up a DR queue manager.

The auto-config and auto-cluster information for a queue manager that is part of a uniform cluster is not backed up automatically. You should back up all files ending in .ini or .mqsc in the mqbackup directory (see Configuring uniform clusters - appliance-specific considerations).

You can back up any type of queue manager while it is running, but this requires sufficient unallocated space on the internal disk to contain a temporary snapshot of the queue manager. This space is not required for a stand-alone queue manager if it is stopped before the backup is taken. HA and DR queue managers are always backed up from an internal snapshot, however, and so always require unallocated space on disk regardless of whether they are running or not.

If you are backing up so that you can use an archive file to migrate the queue manager, or if you want to be able to restore a queue manager to the state it was in at a particular time, then you should stop the queue manager before you back it up.

If the queue manager is running when you run the mqbackup command, a warning message is displayed.

If a queue manager is stopped before you take a backup, it is locked during the backup and cannot be started, deleted or otherwise changed while the backup runs.

Procedure

  1. Connect to the IBM MQ Appliance as described in Command line access.
  2. Log in as a user in the administrators group.
  3. Type mqcli to enter IBM MQ configuration mode.
  4. If this is the first time you have backed up any queue manager, type the following command to allocate storage for your backup:
    createbackupfs -s size
    Where size is the size of the space that is allocated in GB. A directory that is named mqbackup:///QMgrs is created and allocated that storage.
    If you are going to back up queue managers that have encrypted file systems, you should specify that the allocated space is encrypted too. You can specify a passphrase as part of the command, or be prompted for it when you run the command. The passphrase can be between 1 and 512 characters. You should store a copy of the passphrase somewhere safe.
    createbackupfs -s size -e [-p passphrase]
  5. Type the following command to back up a queue manager:
    mqbackup -m QM_name  
    
    Where QM_name is the name of the queue manager that you want to back up. The backup can take some time to run, during which period you cannot use the CLI.
    By default the archive file is named QM_name.bak, but you can add the -o outfilename argument to the mqbackup command to specify a file name, if required:
    mqbackup -m QM_name -o outfilename 
    
    Note: You should take appropriate security precautions when handling the backup file.