Backing Up and Restoring Message VPNs

In addition to backing up the entire Solace PubSub+ event broker configuration database, you can also backup and restore individual Message Virtual Private Networks (VPNs). This is done by running the show current-config User EXEC command on the Message VPN with the CLI output redirection feature (that is, using ">"). This generates a script in the cliscripts directory of CLI configuration commands needed to create (or remove) the configuration for the specified Message VPN:

solace> show current-config message-vpn <vpn-name> [remove] > cliscripts/<script-name>.txt

Where:

<vpn-name> is the full name of the Message VPN to be backed up, or part of the Message VPN name with the wildcard character ? used to represent one character of the name, or the wildcard character * used to represent zero or more characters of the name, where entering only the wildcard character * for the name displays all Message VPNs.

[remove] requests to generate the sequence of CLI configuration commands needed to remove (rather than create) the specified Message VPN.

<script-name> specifies the name of the generated CLI script file.

The generated script can then be run from the cliscripts directory using the source script User EXEC command to either restore or remove Message VPN configurations from event brokers.

For more information on the running of scripts from the Solace CLI, refer to Writing and Running Basic CLI Scripts.

All managed objects within a Message VPN are included in the output of the show current-config command. This includes:

  • Message VPNs
  • client usernames
  • Java Naming and Directory Interface (JNDI) objects
  • Guaranteed message spool queues and topic endpoints
  • VPN bridges
  • PubSub+ Cache clusters and instances
  • Access Control List (ACL) profiles
  • client profiles

Ordinary show User EXEC commands can run in parallel to other commands, but configuration commands run in series to other commands to prevent multiple sources of configuration data (for example, multiple CLI sessions) from colliding with one another. Since the show current config User EXEC command generates the commands required to restore the configuration of a Message VPN at a particular point in time, it also runs in series, like configuration commands. Thus, running the show current config User EXEC command may prevent other commands from running until it completes the current configuration operation.

Backing Up and Restoring VPN Configs on the Same Event Broker

To backup and restore an individual Message VPN configuration on the same event broker, follow these steps:

  1. Run the show current-config User EXEC command to generate the sequence of CLI configuration commands needed to backup the specified Message VPN, redirecting the command output to a script file (for example, mvpn1.cli).
  2. Run the show current-config User EXEC command, this time with the remove attribute, to generate the sequence of CLI configuration commands needed to remove the specified Message VPN, redirecting the command output to a script file (for example, tmp.cli).
  3. Using the remove script generated in Step 2, run the source script User EXEC command to remove the current Message VPN configuration from the event broker.
  4. Using the backup script generated in Step 1, run the source script User EXEC command to restore the Message VPN configuration onto the event broker.

    Always specify the source script User EXEC command attributes stop-on-error and no-prompt so that the script stops running on encountering an error, and that the script also ignores yes/no confirmation prompting.

Backing Up VPN Configs on One Event Broker and Restoring on Another

To backup and restore an individual Message VPN configuration from one Solace PubSub+ appliance to another, follow these steps:

  1. On the first event broker, run the show current-config User EXEC command to generate the sequence of CLI configuration commands needed to backup the specified Message VPN, redirecting the command output to a script file (for example, mvpn1.cli).
  2. Transfer the backup script generated from the first event broker to the second using the copy Privileged EXEC command.
  3. On the second event broker:
    1. Run the User EXEC command, this time with the remove attribute, to generate the sequence of CLI configuration commands needed to remove the specified Message VPN, redirecting the command output to a script file (for example, tmp.cli).
    2. Using the remove script generated in the above substep, run the source script User EXEC command to remove the current Message VPN configuration from the second event broker.
    3. Using the backup script transferred in Step 2, run the source script User EXEC command to restore the Message VPN configuration onto the second event broker.

      Always specify the source script command attributes stop-on-error and no-prompt so that the script stops running on encountering an error, and that the script also ignores yes/no confirmation prompting.

Example:

A sample session to backup the configuration of Message VPN blue on event broker solace1 and restore it on event broker solace2 is:

  1. Generate the sequence of CLI commands needed to backup the Message VPN blue configuration on event broker solace1 by running the following show current-config User EXEC command, redirecting the command output for creating Message VPN blue to script file blue.cli:

    solace1> show current-config message-vpn blue > cliscripts/blue.cli

    CLI paging is automatically disabled for the duration of a redirected CLI command, but confirmation prompts, error and warning messages are not; they remain displayed on the CLI console.

  2. Transfer the script file from event broker solace1 to event broker solace2 using the copy Privileged EXEC command:

    solace1> enable
    solace1# copy cliscripts/blue.cli sftp://admin@solace2/cliscripts

  3. Generate the sequence of CLI commands needed to remove the Message VPN blue configuration on event broker solace2 (so that it can be replaced by the configuration from event broker solace1) by running the following show current-config User EXEC command, redirecting the command output for removing Message VPN blue to script file tmp.cli:

    solace2> show current-config message-vpn blue remove > cliscripts/tmp.cli

  4. Run the following source script User EXEC command to remove the current Message VPN blue configuration from event broker solace2 using script file tmp.cli, always specifying that the script stop running on encountering an error and also ignore yes/no confirmation prompting:

    solace2> source script tmp.cli stop-on-error no-prompt

  5. Run the following source script User EXEC command to restore the configuration of Message VPN blue from event broker solace1 onto event broker solace2 using script file blue.cli, always specifying that the script stop running on encountering an error and also ignore yes/no confirmation prompting

    solace2> source script blue.cli stop-on-error no-prompt