Export data from one CAST Imaging instance and import into another


Summary: Instructions explaining how to export application data from one CAST Imaging and import it into another - i.e. to transfer data between CAST Imaging instances.

Introduction

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 supporting pilots and assessments and also for System Integrators who support CAST Imaging for multiple customers. The tool uses a two-step action:

  • Run export on source host CAST Imaging and transfer output ZIP to target host CAST Imaging
  • Run import of ZIP file on source host CAST Imaging
  • This feature should not be confused with Export and import the Application data which is the process used to transfer application data from CAST AIP schemas into CAST Imaging.
  • Exportimport.exe helps to export the applications directly from neo4J database, and the custom changes made by you will be saved and exported.
  • Note that this tool is only available for CAST Imaging ≥ 1.12.x
  • A limitation exists for this tool: any original ZIP file created by the application import process (see Export and import the Application datacannot exceed 150MB. Anything over this size will likely cause the exportimport.exe tool to fail during the export process.

Microsoft Windows via traditional installer

Step 1 - Locate the tool

The tool is located here and is shipped with CAST Imaging:

%PROGRAMFILES%\CAST\ImagingSystem\imagingetl\exportimport.exe

Step 2 - View available options

You can view a list of available options by running:

exportimport.exe -h
CommandDescription
-h  helpView a list of available options.
--exportapp APPNAME

Exports the specified application to ZIP. This command should always be placed in last position in the command line (if you are using it with other commands).

A limitation exists for this tool: any original ZIP file created by the application import process (see Export and import the Application datacannot exceed 150MB. Anything over this size will likely cause the exportimport.exe tool to fail during the export process.

--importapp APPNAME.zipImports the ZIP file created by the --exportapp command. This command should always be placed in last position in the command line (if you are using it with other commands).
--listofapplications

Lists the applications that already exist on the target neo4j server.

--database DATABASE_NAME

This option allows the export and import of applications from specific tenants/domains within CAST Imaging (one tenant/domain = one "Neo4j" database). When the option is omitted, the default value is neo4j which corresponds to the tenant/domain called "default". If you use this option, it must ALWAYS be placed before the action command (--exportapp / --importapp) in the command line.

Example:

exportimport.exe --database "my_tenant" --exportapp MEUDON
exportimport.exe --database "my_tenant" --importapp MEUDON.zip

In most cases, the tenant/domain names in CAST Imaging UI will match the Neo4j database name, but in some situations the two may not match (i.e. when the tenant/domain has been renamed in the Admin Center UI, the database name will remain the same). You should therefore use the --listofapplications option to find/confirm the database name as shown below:

--user USER

Username used to connect to the neo4j server. The default value is neo4j. This option can be omitted if you have not changed the neo4j user name.  If you use this option, it must ALWAYS be placed before the action command (--exportapp / --importapp) in the command line.

--password PASSWORD

Password corresponding to the USER used to connect to the neo4j server. The default value is imaging. This option can be omitted if you have not changed the neo4j user password.  If you use this option, it must ALWAYS be placed before the action command (--exportapp / --importapp) in the command line.

--port PORT

Port number for neo4j server. The default value is 7687. This option can be omitted if you have not changed the neo4j server port number.  If you use this option, it must ALWAYS be placed before the action command (--exportapp / --importapp) in the command line.

--location LOCATION

Determines the installation location of CAST Imaging on the host server. This option can be omitted if you are using the default installation locations.  If you use this option, it must ALWAYS be placed before the action command (--exportapp / --importapp) in the command line. Default values are:

Windows: "C:\\ProgramData\\CAST\\ImagingSystem\\Neo4j_data\\import"
Docker: "/opt/CAST/container-support/neo4j/csv/"


--schemeThis option is not currently functional. It has been added for a future feature which will bring clustered neo4j databases.

Step 3 - Find your chosen Application on source CAST Imaging

Use the following command to find the name of the Application you want to export on the source CAST Imaging:

exportimport.exe --listofapplications

Step 4 - Export your chosen Application on source CAST Imaging

Use the following command on the chosen source CAST Imaging instance to export the Application, for example for an Application called MEUDON. This will create a ZIP file called MEUDON.zip in the current folder. You will then need to transfer this ZIP file to the chosen target CAST Imaging host for import:

exportimport.exe --exportapp MEUDON

Step 5 - Import your chosen Application on target CAST Imaging

Use the following command on the chosen target CAST Imaging instance to import the ZIP file created with the --exportapp command on the source CAST Imaging:

exportimport.exe --importapp MEUDON.zip

Docker for Linux/Windows

Step 1 - obtain the tool(s)

The tools are provided with the Docker images, therefore as long as CAST Imaging has been installed, you can proceed.

Step 2 - Available options

The available options are not the same as those available in a direct on Microsoft Windows installation:

CommandDescription
--exportapp APPNAME

Exports the specified Application to ZIP.  This command should always be placed in last position in the command line (if you are using it with other commands).

A limitation exists for this tool: any original ZIP file created by the application import process (see Export and import the Application datacannot exceed 150MB. Anything over this size will likely cause the exportimport.exe tool to fail during the export process.

--restoreapp APPNAME.zipImports the ZIP file created by the --exportapp command. This command should always be placed in last position in the command line (if you are using it with other commands).
--database "DATABASE_NAME"

This option allows the export and import of applications from specific tenants/domains within CAST Imaging (one tenant/domain = one "Neo4j" database). When the option is omitted, the default value is neo4j which corresponds to the tenant/domain called "default". If you use this option, it must ALWAYS be placed before the action command (--exportapp / --restoreapp) in the command line.

In most cases, the tenant name in CAST Imaging UI will match the Neo4j database name, but in some situations the two may not match (i.e. when the tenant has been renamed in the Admin Center UI, the database name will remain the same).

Examples:

Linux: ./imaging --database "my_tenant" --exportapp MEUDON
Microsoft Windows: imaging.exe --database "my_tenant" --exportapp MEUDON

or:

Linux: ./imaging --database "my_tenant" --restoreapp MEUDON.zip 
Microsoft Windows: imaging.exe --database "my_tenant" --restoreapp MEUDON.zip

When the option is omitted, the default value is neo4j which corresponds to the tenant called "default".

Step 3 - Export your chosen Application on source CAST Imaging

Use the following command on the chosen source CAST Imaging instance to export the Application, for example for an Application called MEUDON. This will create a ZIP file called MEUDON.zip in the current folder. You will then need to transfer this ZIP file to the chosen target CAST Imaging host for import:

Docker Installer extension (run the command from the folder created when unzipping the extension):
Linux: ./imaging --exportapp MEUDON
Microsoft Windows: imaging.exe --exportapp MEUDON

Step 4 - Import your chosen Application on target CAST Imaging

Use the following command on the chosen target CAST Imaging instance to import the ZIP file created with the --exportapp command on the source CAST Imaging:

Docker Installer extension (run the command from the folder created when unzipping the extension):
Linux: ./imaging --restoreapp MEUDON.zip
Microsoft Windows: imaging.exe --restoreapp MEUDON.zip

Known Issues

When using the tool on a Linux operating system, a permissions issue may arise which will not allow the creation of the files in the neo4j/csv folder. To resolve this, run the following command to change the permissions:

Linux Docker Installer extension (deprecated):
chmod -R 777 /opt/CAST/container-support/neo4j/csv/