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:
- 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
). - Run the
show current-config
User EXEC command, this time with theremove
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
). - 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. - 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 attributesstop-on-error
andno-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:
- 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
). - Transfer the backup script generated from the first event broker to the second using the
copy
Privileged EXEC command. - On the second event broker:
- 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
). - 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. - 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 attributesstop-on-error
andno-prompt
so that the script stops running on encountering an error, and that the script also ignores yes/no confirmation prompting.
- Run the User EXEC command, this time with the
Example:
A sample session to backup the configuration of Message VPN blue
on event broker solace1
and restore it on event broker solace2
is:
- Generate the sequence of CLI commands needed to backup the Message VPN
blue
configuration on event brokersolace1
by running the followingshow current-config
User EXEC command, redirecting the command output for creating Message VPNblue
to script fileblue.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.
- Transfer the script file from event broker
solace1
to event brokersolace2
using thecopy
Privileged EXEC command:solace1> enable
solace1# copy cliscripts/blue.cli sftp://admin@solace2/cliscripts - Generate the sequence of CLI commands needed to remove the Message VPN
blue
configuration on event brokersolace2
(so that it can be replaced by the configuration from event brokersolace1
) by running the followingshow current-config
User EXEC command, redirecting the command output for removing Message VPNblue
to script filetmp.cli
:solace2> show current-config message-vpn blue remove > cliscripts/tmp.cli
- Run the following
source script
User EXEC command to remove the current Message VPNblue
configuration from event brokersolace2
using script filetmp.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
- Run the following
source script
User EXEC command to restore the configuration of Message VPNblue
from event brokersolace1
onto event brokersolace2
using script fileblue.cli
, always specifying that the script stop running on encountering an error and also ignore yes/no confirmation promptingsolace2> source script blue.cli stop-on-error no-prompt