Date: Fri, 29 Mar 2024 15:37:26 +0000 (UTC) Message-ID: <2112613869.3399.1711726646727@[3.220.22.64]> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3398_929079320.1711726646724" ------=_Part_3398_929079320.1711726646724 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This page documents the use of admin tools to generate sample data.
This tool is used to generate sample data. It can be used after Create Database and Reindex Objects are independent= ly run, or can be run with a "mode" parameter that causes those steps to be= automatically run. This tool is an easy way to refresh the database = with contents that can be used for testing.
Following are some details about the implementation of this tool:
Mojo: GenerateSampleData.java (in admin/src/main/resour=
ces/java/org/ihtsdo/otf/refset/mojo)
Project: admi=
n
Configuration Parameters
mode - "create" will destroy the database and indexes and recreate t= hem before loading sample data. any other value than "create" will as= sume those prior steps have already been run.
There is a simlar tool run with "Sample2" as the profile that also gener= ates sample data that looks more realistic but does not work with integrati= on tests.
Sample command line call of the admin tool to recreate a database, clear= indexes, and load sample data:
% cd /home/iht= sdo/refset/code/admin % mvn install -PSample -Dmode=3Dcreate -Drefset.config=3D/home/ihtsdo/refse= t/config/config.properties
If running "Sample" with -Dmode=3Dcreate, you may have errors due to do = with a legacy table structure with indexes or foreign keys that are no long= er valid. Clear the state of the database first by either dropping an= d recreating the schema, or by running the contents of "admin/src/main/reso= urces/truncate_all.sql" into your database.
# stop the ser= ver % service tomcat7 stop =20 % cd /home/ihtsdo/refset/code % mysql -u<user> -p refset < admin/src/main/resources/truncate_all= .sql =20 % cd /home/ihtsdo/refset/code/admin % mvn install -PSample -Dmode=3Dcreate -Drefset.config=3D/home/ihtsdo/refse= t/config/config.properties