Import and export objects

The Web Dashboard import and export functionality is used to backup Web Dashboard objects or to export them in another Sentinel installation. The import and export can be accomplished from the GUI Import and Export or the Command Line Import and Export. For example, the result file produced by the export command may be used to import objects into Web Dashboard using the GUI or the import command.

Use Case

The following steps provide a typical use case scenario for an export and import from a Sentinel test environment to a Sentinel production environment:

  1. Define and test objects in a test environment.
  2. Export them to a locally saved archive file.
  3. Import the archive file into a production environment.
Note   The export file of a Data Dictionary holds the schema/catalog information. The default behavior is to use this information at import time. But there are situations where the import needs to be done on a schema/catalog with different name, so the information present in the export file should be ignored. In order to activate this latter behavior, a new property is available starting with Service Pack 8. The property webdashboard.schema.independent.import= true needs to be manually added in server.properties.

GUI Import and Export

You can use the Web Dashboard GUI to import and export Web Dashboard objects.

Export objects from the GUI

  1. Go to Administration > XML Export.
  2. Select the Add button icon green plus sign.
  3. The Add Objects tab displays a list from you can choose object types.
  4. Click objects in the list to select them. Select consecutive objects by pressing and holding Shift and clicking objects from the list. Select non-consecutive objects by pressing and holding Ctrl while clicking objects from the list.
  5. Optionally, use the following fields to specify further constraints regarding object dependencies and versions.
  6. Field Description

    Version

    Filter selected objects to include only the version you specify. If you do not specify any, all objects, regardless of their version, are returned on the next page.

    Modification date

    Filter selected objects to include only those modified on the date you specify. If not specified all objects, regardless of their modification date, will be returned on the next page.

    Dependent objects

    Check to include dependencies of the selected objects. For example, if you select this check box and you select Dashboard as the object type to be exported, Reports will also be automatically considered for export.

    Dependency level

    Filter dependent objects to only those having the dependency level equal to or less than the level you specify. For example, a Dashboard is made of Reports, which rely on Data dictionaries, which rely on Worlds. In this situation, relative to the Dashboard, Reports are dependency level 1, Data dictionaries are level 2, and Worlds are level 3.

  7. Select the Right arrow button icon green right arrow on the bottom of the page.
  8. The Search Results tab displays the a table listing the objects that match the criteria you specified.
  9. On the Search Results tab, select the check box next to each object you want to include in the export and then select the Right arrow button icon green right arrow on the bottom of the page.
  10. The Objects to export tab displays only those objects for which the user has read rights.
  11. Optionally, on the Objects to export tab, you can do the following:
    • Add objects to the list: Select the Add button icon green plus sign to display the Add Objects tab.
      1. Select the Add button icon green plus sign in the toolbar to display the Add objects tab, where you select objects and filter them by their type, name and version.
      2. Click the Right arrow button icon green right arrow to display the Search results page and select objects to be included in the Add operation.
      3. Click the Right arrow button icon green right arrow to display Objects to export tab, where the new results are appended to the original ones.
    • Add the Delete action to your export operation for an object instance: When you add the Delete action for an object, the object will be deleted from the target environment when you import the data again.
      1. Select the Close button Red X on the toolbar to display the Delete objects tab, where you select objects and filter them by their type, name and version.
      2. Select the Right arrow button icon green right arrow to display the Search results page and select objects to be included in the Delete operation.
      3. Select the Right arrow button icon green right arrow to display Objects to export tab, where the new results are appended to the original ones.
    • Note The Close button Red X cannot be used in conjunction with the check boxes in the Objects to export view.
    • View dependencies
      1. Select one or more objects from the list and select Web Dashboard button with two branches off one to display the Search Results tab.
      2. Select one or more objects from the Search Results tab.
      3. Click the Right arrow button icon green right arrow to display Objects to export tab, where the new results are appended to the original ones.
    • Reorder your list
      1. Select the check box for one or more objects you want to move up or down the list.
      2. Click next to an object in the list to move the selected objects above it on the list.
    • Delete objects from your list – Click the Close button Close button Red X next to the object in the list you want to remove.
  12. After you have established your list of objects to be exported, you can:
    • Click XML Export to generate your export file. You will be prompted to save the resulting archive on your local host.
    • Click Save to save your current export setup (i.e. list of objects, actions) on the server host. To save your export setup , you must first manually create the folder prelytis/var on your server in the Tomcat runtime directory. After your setup is saved, next time you access the Administration > XML Export option, you can use the Load button to work with the previously saved setup.

Import objects from the GUI

You can import your previously exported and saved XML files.

  1. Go to Administration > XML Import.
  2. Choose the file you want to import. Either identify it on the server or navigate to it on your local system.
  3. Select the file and click the Right arrow button icon green right arrow to continue.
  4. The contents of the archive are displayed in the order established at export time.
  5. For each object, the following data is displayed:
  6. Field Description

    Objects

    The object type

    Name, Description

    The name and the description of the object

    XML version

    The version of the object stored in the export archive

    DB version

    The version of the object stored in the database (if any)

    NONE, UPDATE, DEL

    The action specified for the object when importing.

    • NONE – the object will be ignored.
    • UPDATE – the object in the database will be updated if its version is earlier than the version in the export file, or created if it does not exists.
    • DEL – the object will be deleted if its version in the database is earlier than the version in the export file.
  7. Even if the application has selected an action for each object by default, you can override it and specify a different action; for example, NONE.
  8. Reset the default actions by pressing the icon yellow double arrows button on the toolbar.
  9. Optionally, test your import. Click the icon white right arrow inside a yellow triangle button.
  10. Import your data. Click the button on the toolbar.

Command Line Import and Export

You can use the command line to import and export Web Dashboard objects. Commands provide a brief output on the console, and more details in the Web Dashboard logs.

Export objects from command Line

The following export batch files are delivered in Sentinel Web Dashboard:

  • export.bat - Windows platforms
  • export.sh - Linux/UNIX platforms

The command is located in the following server side folder:

<SENTINEL_INSTALLATION_DIRECTORY>/Sentinel/jetty/webapps/SentinelWebDashboard/tools

Use the argument -help to run the command and display its use.

Note   If Web Dashboard is deployed on a Tomcat instance rather than on the internal web server, set the JAVA_HOME environment variable before running the import or export command. For Linux/UNIX platforms, use chmod to grant access to these commands.

In the example below, the export command is used to export a list of objects. The objects are specified in the order they are exported. When you import the resulting file into Web Dashboard, the import is done in the same order.

export.bat -u foo -p pass123 -d Acme -nameAndType "MyDashboard Dashboard MyReport1 Report MyReport2 Report MyData Dictionary" -f c:\impexp\myexport.zip

Note   Quotation marks are mandatory when specifying the value for the -nameAndType option. The type of each object can be listed when running the export command with the option -help.

Exit Codes:

  • 0 - Successful export
  • 1 - Unsuccessful export

Import objects from the command line

The following import batch files are delivered in Sentinel Web Dashboard:

  • import.bat - on Windows platforms
  • import.sh - on Linux/UNIX platforms

The command is located in the following server side folder:

<SENTINEL_INSTALLATION_DIRECTORY>/Sentinel/jetty/webapps/SentinelWebDashboard/tools

Use the argument -help to run the command and display its use.

Note   If Web Dashboard is deployed on a Tomcat instance rather than on the internal web server, set the JAVA_HOME environment variable before running the import or export command. For Linux/UNIX platforms, use chmod to grant access to these commands.

When you import the results of the export file into Web Dashboard, the objects are imported in the same order as they were exported. For example, the following import command is used:

import.bat -u foo -p pass123 -d Acme -f c:\impexp\myexport.zip

Each time an import is attempted, Web Dashboard will calculate the appropriate action according to the object's version. For example, if a newer version of an object already exists in Web Dashboard, the application will skip the update when importing an older version of the same object. The import command will return exit code 1 when there are objects skipped during the import. By using the -force option with the import command, you will force the update of objects, regardless of their version.

Exit Codes

  • 0 - Successful export
  • 1 - Unsuccessful export

Related Links