Setting up & Using Data Population CLI Tool
Setting up CLI Tool
The following files are required to run Data Population from the command line:
Artifact | Module | File Name |
---|---|---|
Data Population Data | database/ext-data | ext-data-<version>.jar |
Data Population CLI Tool | database/ext-data-population-cli | ext-data-population-cli-<version>-package.zip |
To get the files:
Download the files directly from the Nexus repository
Build the files in the local development environment:
To build the data population client tool, navigate to the
extensions/data-population
module and run the following command:mvn clean install
To build data population data , navigate to the
extensions/database
module and run the following command:mvn clean install
Extract the files from the deployment package that is built by the
deployment/ext-deployment-package
module
You can use an environment-specific directory that is defined in the extension
module, such as the environments/local
directory or use an external configuration directory that is not part of the extension module, for example production environment.
If you use an external configuration directory, ensure that the directory has the same structure as the environments/local
directory.
Running the Data Population CLI Tool
Ensure that the
dataDirectory
contains the following sub-directories:config
data
environments
schema
Ensure that the
dataDirectory
specified is the parent directory of the four of the directories, not thedata
sub-directory
Do one of the following:
- For Linux-based Operating Systems, run
data-population.sh
- For Windows-based Operating Systems, run
data-population.bat
Linux
For Linux-based operating systems that is running from the development environment:
cd data-population/ext-data-population-cli/target/ext-data-population-cli-1.0-SNAPSHOT
./data-population.sh --dataDirectory ../../../../database/ext-data/target/classes/
--configDirectory ../../../../database/ext-data/target/classes/environments/local
[update-db|reset-db]
For Linux from an external configuration directory:
./data-population.sh --dataDirectory /home/epuser/ep/workspace/data-population --configDirectory /etc/ep/conf/prod-data-population/ [update-db|reset-db]
Windows
For Windows-based operating systems that is running from development environment:
$ cd data-population\ext-data-population-cli\target\ext-data-population-cli-1.0-SNAPSHOT
$ data-population.bat --dataDirectory ..\..\..\..\database\ext-data\target\classes\ --configDirectory ..\
..\..\..\database\ext-data\target\classes\environments\local [update-db|reset-db]
Command Line Parameters
The --dataDirectory
and --configDirectory
configuration arguments specify the configuration that the Data Population CLI tool runs with. You can also specify these commands to run at the runtime so that the tool starts the commands and then exits when complete.
--dataDirectory <data directory>
Configures the data
directory.
Type: Configuration Argument
--configDirectory <config directory>
Configures the config
directory.
Type: Configuration Argument
reset-db
Deletes, recreates, and populates the database.
Type: Command Argument
update-db
Updates the existing database by populating any updates after the last run.
Type: Command Argument
filter-data --output <output directory>
Filters the data in the data directory to an6 output directory.
Type: Command Argument
The filter-data
command is an additional command for the CLI tool. The filter-data
command filters the data contained in the data directory to an output directory, but does not start Liquibase or interact with the database.
You can the filter-data
command later, separate from the Data Population tool, by running the Import/Export tool and Liquibase tools directly. Elastic Path recommends the blended deployment model that the update-db
command provides.
For more information, see Data Population Deployment Models.