Exporting and importing applications
Overview
If you have multiple CAST Imaging instances and would like to be able to export application data from one CAST Imaging and import it into another, you can do so following the instructions below. This feature is mainly aimed at those who are using CAST Imaging in a read-only / standalone deployment scenarios for Viewer.
How does it work?
This feature relies on a command line tools exportimport
provided with CAST Imaging and uses a two-step action:
- Run the tool on the “source” host CAST Imaging deployment in export mode to generate an output
.zip
file for the application(s) you want to transfer - Transfer the output
.zip
file to the “target” host CAST Imaging deployment - Then import the application either:
- by running the tool in import mode on the output
.zip
file - by importing the output
.zip
file via the Add Application option in the UI - see read-only / standalone deployment scenarios for Viewer for more information.
- by running the tool in import mode on the output
What does the tool export?
The tool interacts directly with neo4j where application analysis results are stored. As such, any customization that has been made to the results, such as the addition of Post-Its or Tags, will be included.
Where can I find the tool?
%PROGRAMFILES%\CAST\Imaging\CAST-Imaging-Viewer\imagingetl\exportimport.exe
/opt/cast/installation/imaging-viewer/imaging (executable)
Where should I run the tool from?
In the vast majority of situations, CAST recommends running the tool on each machine, i.e.:
- first run the tool on the source machine (where the
imaging-viewer
component is installed) and where the application(s) to export is/are located. - then move to the target machine (on which the
imaging-viewer
component is installed) and where you want to import the application(s) and run the import.
If you would like to run the tool to export, import or list applications from a machine where the imaging-viewer
component is installed but you want to target a neo4j instance on a different machine, ensure you always use the --remoteneo4j
flag (see below) together with --neo4jhostname <hostname>
to specify the remote instance.
Command line options
Option | Description |
---|---|
-h , --help |
Show the help message and exits. |
--exportapp <my_app> |
Export the named application and output to .zip file. Will be stored in the same folder as the tool executable unless --exportpath <path> is defined. |
--listofapplications |
Lists the applications that already exist on the neo4j server. |
--importapp <my_app.zip> |
Import the output .zip file. |
--user USER |
Username used to connect to the neo4j server. The default value is neo4j . Unless you have customized the user name, this option can be omitted. If you do use this option, it must ALWAYS be placed before the action command (--exportapp / --importapp ) in the command line. |
--password <password> |
Password to match the --user option. The default value is imaging . Unless you have customized the password, this option can be omitted. If you do use this option, it must ALWAYS be placed before the action command (--exportapp / --importapp ) in the command line. |
--neo4jport <port> |
Port for neo4j. Unless you have customized the port, this option can be omitted (default: 7697 (corresponds to Microsoft Windows. On Linux via Docker installations, the neo4j port runs by default on 7687 )). |
--neo4jhostname <hostname> |
Hostname for neo4j. Unless you are targetting a remote instance (where --remoteneo4j is also required), this option can be omitted (default: 127.0.0.1 ). |
--neo4jscheme <scheme> |
Scheme for neo4j. Unless you have customized the user name, this option can be omitted (default: neo4j ). |
--database <database> |
This option allows the export and import of applications from specific tenants within CAST Imaging (one tenant = one “neo4j” database). When the option is omitted, the default value is neo4j which corresponds to the default tenant called default . Use --listofapplications to determine the database name. If you use this option, it must ALWAYS be placed before the action command (--exportapp / --importapp ) in the command line. |
--location <path> |
Determines the installation location of CAST Imaging on the host server. Unless you have customized the installation location, this option can be omitted. If you use this option, it must ALWAYS be placed before the action command (--exportapp / --importapp ) in the command line (default: Linux /opt/cast/installation/imaging-viewer/neo4j/csv/ Microsoft Windows %PROGRAMDATA%\CAST\Imaging\CAST-Imaging-Viewer\Neo4jData\import\ ) |
--unifiedhost <hostname> |
Access URL for CAST Imaging, e.g. http://imaging.corp.domain.com . Only necessary when using --importapp <my_app.zip> (default: http://localhost ). |
--unifiedport <port> |
User access port for CAST Imaging, e.g. 8090 or 443 . Only when using --importapp <my_app.zip> and --unifiedhost <hostname> . Unless you have customized the port, this option can be omitted (default: 8090 ). |
--apikey <api_key> |
User API key to authenticate with CAST Imaging (can be generated in the Profile section in the UI). Required only when using --importapp <my_app.zip> . |
--batchsize <batchsize> |
Batch size to process neo4j queries - can be adjusted downwards for very large applications and according to the host machine’s available RAM (default: 1000 ). |
--exportpath <path> |
Allows the generated export ZIP file to be stored in a custom folder. Should only be used with the --exportapp option. If omitted, the export ZIP will be stored in the same folder as the exportimport.exe / imaging executable. |
--remoteneo4j |
Use only if neo4j is located on a separate machine to CAST Imaging. See also --neo4jhostname <hostname> . |
Example command lines
Determine applications and their tenant name
--listapplications
Export an application
Minimum required options (i.e. all other options at their default):
--exportapp my_app
Some customized options:
--database tenant1 --exportpath "C:\TargetDir" --user neo4j_changed --password somepassword --neo4jhostname 192.168.200.202 --neo4jport 7600 --exportapp my_app
Import an application
Minimum required options (i.e. all other options at their default):
--apikey <api_key> --importapp my_app.zip
Some customized options:
--database tenant2 --user neo4j_changed --password somepassword --neo4jhostname 192.168.200.204 --neo4jport 7600 --apikey api_key --unifiedhost http://imaging.corp.domain.com --unifiedport 9090 --importapp my_app.zip