Overview

This page documents the use of admin tools to import, export, and remove map project data.

Prerequisites

  • MySQL database must already exist (e.g. "mappingservicedb").
  • MySQL database connection parameters must be defined in the properties file specified by "run.config".
  • Create/Update DB mojo must also have already run so that the database schema exists.
  • IMPORTANT: The Tomcat server must not be running while this is run, otherwise indexes can get corrupted.

Details

These tools are used to export and import map project data.  The mapping-service-data project on CollabNet contains sample projects used by IHTSDO that can be loaded using this mechanism.  You can also use this to transport map project info between systems, say UAT and PROD.

It uses an XML serialization for most map projecct data and then text files for scope includes and excludes concepts.

 

The map project data import tool takes a directory containing one or more serialized map project XML files and scope definitions and loads them in.  This mojo is most often used to load a development environment with sample map projects rather than having to create them from scratch.  It can also be used as a  means to transport map project definitions from one system to another (e.g. import map projects exported from the other system).

Mojo: MapProjectDataImportMojo.java (in admin/mojo/src/main/resources/java/org/ihtsdo/otf/mapping/mojo)

Project: admin/import

Configuration Parameters

  • A profile of "MapProject" must be specified.
  • run.config - the standard configuration file specified as a -D parameter
  • import.dir - the input directory specified as a -D parameter
    • This is the directory where imported projects be loaded from.
  • mini - specify this to be "true" (e.g. -Dmini=true) if database is loaded with a mini version of SNOMEDCT to avoid problems looking up scope concepts. This is used during a development load to avoid unnecessary errors related to non-existent scope concepts.

 

The map project data export tool writes all map projects (and scope definitions) from the target system into a directory.  These can then be imported into another system as needed.

Mojo: MapProjectDataExportMojo.java (in admin/mojo/src/main/resources/java/org/ihtsdo/otf/mapping/mojo)

Project: admin/export

Configuration Parameters

  • A profile of "MapProject" must be specified.
  • run.config - the standard configuration file specified as a -D parameter
  • output.dir - the output directory specified as a -D parameter
    • This is the directory where exported projects will go.

 

The map project data remover is used to remove all map projects entirely from a database.  This is typically used during the development cycle to reset some state information and try again.

Mojo: MapProjectDataRemoverMojo.java (in admin/mojo/src/main/resources/java/org/ihtsdo/otf/mapping/mojo)

Project: admin/remover

Configuration Parameters

  • A profile of "MapProject" must be specified.
  • run.config - the standard configuration file specified as a -D parameter

Samples

Sample command line call of the admin tool to import project data into a system loaded with SNOMEDCT "mini" data. Leave the "mini" flag off if importing projects into a database loaded with full SNOMEDCT.

% cd ~/code/admin/import
% mvn install -PMapProject -Dmini=true -Drun.config=/home/ihtsdo/config/config.properties -Dinput.dir=/home/ihtsdo/data/ihtsdo-project-data

Sample command line call of the admin tool to export existing map project data to files:

% cd ~/code/admin/export
% mvn install -PMapProject -Drun.config=/home/ihtsdo/config/config.properties -Doutput.dir=/home/ihtsdo/data/ihtsdo-project-data

 

Sample command line call of the admin tool to remove all map project data:

% cd ~/code/admin/remover
% mvn install -PMapProject -Drun.config=/home/ihtsdo/config/config.properties

 


Sample Eclipse run configuration for importing project data when mini SNOMEDCT is loaded:

 

Sample Eclipse run configuration for exporting project data:

Sample Eclipse run configuration for removing project data:

  • n/a

 

  • No labels