You can export the following components from one BMC Network Automation system into an XML file that you can then import into another BMC Network Automation system. You also can import components that you create manually.
This topic describes how to export and import components using a script.
The scripts are available in the bcan-import-export- v.r.mm.zip file in the BCAN_HOME\public\bmc\bca-networks\extras directory. When the file is unzipped, the scripts are in the bin subdirectory. The lib subdirectory contains the libraries needed to run the scripts.
Note
The string v.r.mm is a substitute for the current version of the BMC Network Automation software.
Both Linux and Microsoft Windows scripts are available. For usage information, invoke any of the scripts with a -?
option. This option displays the list of input parameters.
Note
For example, when importing a predefined job containing a Deploy to Active template action, the BMC Network Automation system should already have a template by that name. Alternatively, the template can also be imported, but import it prior to importing the predefined job, or add the template to the XML file that is being imported and place it before the predefined job.
Invoke the export.bat
or export.sh
command with the following options:
Option | Description |
---|---|
-? | Displays help |
| Specifies the component to export: Valid values:
|
| (Optional) Specifies the full name of a container blueprint; do not use wildcards in the the container blueprint name. |
| Specifies the name of the export file |
| (Optional) Specifies the character encoding to be used to when creating the output file during export Valid values: UTF-16, UTF-8 (default) |
| (Optional) Specifies the name of the component to export You can use wildcards; for example, Bronze container. The following option is only applicable to container blueprints: The number of the revision to be exported can be specified as per the following format: <ContainerBlueprintName>#<RevisionNumber> If no filter is specified when exporting container blueprints, all revisions of the container blueprints are exported. |
| Specifies the BMC Network Automation server password |
| Specifies the BMC Network Automation server URL in the following format: |
| Specifies the BMC Network Automation server user name |
-v | Prints detailed error stack trace |
Invoke the import.bat
or import.sh
command with the following syntax and options:
import
options
filename
[
filename
...]
Note
If you had exported the following components before installing BMC Network Automation 8.6 and the <poolMask>
tag existed, ensure that you change its value from dotted decimal format to CIDR format, otherwise, the import will fail:
Pod
Pod blueprint
Container
Container blueprint
A container is tightly bound to a specific BMC Network Automation system. Rarely, when you export and import pods and containers from one system to another, imported job numbers will not map to the jobs in the system to which they are imported.
A container is imported successfully if the target system does not contain any job at all or if no existing jobs match the ones present in the imported file. If the job numbers map and you click the links of an imported container, you would be looking at incorrect information.The following options
are available for this command:
Option | Description |
---|---|
-? | Displays help |
| (Optional) Specifies the character encoding to be used to read the input files during import Valid values: UTF-16, UTF-8 (default) |
| Specifies the BMC Network Automation server password |
| (Optional) Specifies the import scope that designates the components to import Valid values:
|
| Specifies the BMC Network Automation server URL in the following format: |
| Specifies the BMC Network Automation server user name |
-v | Prints detailed error stack trace |
Replace filename
with the names of one or more XML files that were exported from a BMC Network Automation server.
These file names can contain absolute or relative paths. If a file name contains a blank space, it must be enclosed in double quotation marks (").
You can also use wildcards (for example, *myfile.xml*
).