If you use CLI to export a profile, you must archive the configuration and then export it. To import a profile, you must import the archive into the NetScaler appliance and then run the restore command to extract the configuration. The following set of CLI commands can be used for exporting, importing and managing the profile configurations.
CLI commands to export archives:
CLI commands to import archives:
CLI commands to manage archives:
-
show appfw archive
-
rm appfw archive <name>
Exporting a profile from one appliance and importing it to another requires five steps in CLI. The first 3 steps are performed on the source appliance on which profile configuration is originally created, and the next 2 steps are performed on the target appliance on which the profile configuration is to be replicated.
Export profile from the source NetScaler appliance:
Step 1: Create an archive of the configured profile.
Step 2: Export the archive to the NetScaler file system.
Step 3: Use a file transfer utility such as scp to transfer the exported archive file from NetScaler appliance A to the target NetScaler appliance.
Import profile to the target NetScaler appliance:
Step 4: Run the import command to import the archived file. You can import the archive from your NetScaler’s local file system, or you can use HTTP or HTTPS protocol to import the archive from a server by using the URL.
Step 5: Run the restore command to restore the profile configuration from the imported archive
To export an Web App Firewall profile by using the command line interface:
First, archive the profile’s configuration, and then export the archive to a target location. At the command prompt, type the following commands:
archive appfw profile <profileName> <archiveName>
where:
Execution of the preceding command creates 2 instances of the archive file. One in the /var/nslog folder and another in the /var/archive/appfw folder.
export appfw archive <archiveName> <target>
where:
-
<archiveName> is the name of the archive to export. (The same name as in the previous command).
-
<target> is a file path starting with local: as the prefix, followed by <archiveName>.
Execution of the export command saves the exported archive file on the file system of your NetScaler appliance in the /var/nslog folder.
Examples:
> archive appfw profile test_pr archived_test_pr
> export appfw archive archived_test_pr local:dutA_test_pr
After the above two commands are run, the /var/nslog folder contains the archived_test_pr file and the exported copy, dutA_test_pr, which are identical in size. From the CLI, you can drop into the shell to navigate to the folder to verify that these files are there.
After exporting the archive file, you can use scp or some other such file transfer utility to transfer a copy of the archive file from the NetScaler appliance on which they were created to your target NetScaler appliance.