Configuring System Settings Using EP-Core-Tool
The EP Core Tool is an application for updating your system configuration settings through the command line. The application comes in two types:
- EP Core Tool Maven Plugin
- EP Core Tool Command Line Application
The core-tool is in three separate modules:
ep-core-tool-logic
- Contains the core tool logic and embedded EP coreep-core-tool
- Contains the maven plugin that depends onep-core-tool-logic
ep-core-tool-cli
- Contains the command line application that depends onep-core-tool-logic
The ep-core-tool
allows you to:
- Change Commerce Manager User Passwords
- Ping the Search Server
- Rebuild search indexes
- Set Elastic Path system settings
- Get ep-core-tool Help
Installing EP Core Tools
The following must be set up on your production server:
- The production database is installed
- Your Nexus server is accessible
ep-core-tool-logic
is deployed to your Nexus- Your server is currently running
Command Line Application
To install the EP Core Tool Command Line Application:
Set the production server’s database details in:
core\ep-core-tool-cli\src\main\resources\epcoretool.config
.From the command line, run
mvn install in core\ep-core-tool-cli
to build the tool.The application builds to:
core\ep-core-tool-cli\target\ep-core-tool-cli-<VERSION>-bin.zip
Transfer and unzip the file to a folder on your production server.
Install your database’s JDBC driver:
Linux - set
IE_CLASSPATH
to the fully-qualified path and jar filename of your JDBC driverFor example, export
IE_CLASSPATH=/home/ep/.m2/repository/mysql/mysql-connector-java/5.1.44/mysql-connector-java-5.1.44.jar
.Windows - drop the JDBC driver into your deployment’s lib folder:
ep-core-tool-cli-7.0.0-SNAPSHOT\lib
Open a command line and run operations from the folder as shown in the sections below.
Maven Plugin
To install the EP Core Tool Maven Plugin:
Set the production server’s database details in your
.m2/settings.xml
file.Build the Maven Plugin to your production server’s Maven repository.
Open a command line and run operations from a directory with a Elastic Path
POM
file as shown in the sections below.
note
You must run the EP Core Tool Maven Plugin commands inside a directory containing an Elastic Path POM
file or else the commands will fail.
Using EP Core Tools
Changing Commerce Manager User Passwords
This Maven command updates Commerce Manager user passwords:
Using Maven Plugin:
mvn ep-core-tool:set-cmuser-password -Dusername="USER" -Dpassword="PASSWORD"
Using CLI:
epcoretool.bat set-cmuser-password user=password
note
The password must pass validation checks before it sets.
$ mvn ep-core-tool:set-cmuser-password -Dusername="admin" -Dpassword="ep31337"
[INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
[INFO] ------------------------------------------------------------------------
[INFO] Building EP Core Maven Plugin
[INFO] task-segment: [ep-core-tool:set-cmuser-password]
[INFO] ------------------------------------------------------------------------
[INFO] [ep-core-tool:set-cmuser-password {execution: default-cli}]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
Pinging Search Server
Ping the search server to discover the number of products that have been indexed.
Using Maven Plugin:
mvn ep-core-tool:ping-search
Using CLI:
epcoretool.bat ping-search
Example output:
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
[INFO] ------------------------------------------------------------------------
[INFO] Building ep-core-tool Maven Mojo
[INFO] task-segment: [ep-core-tool:ping-search]
[INFO] ------------------------------------------------------------------------
[INFO] Search service has 12481 products indexed in your default locale.
[INFO] BUILD SUCCESSFUL
Rebuild Search Index
Rebuild All Index
To request all search server indexes to rebuild.
Using Maven Plugin:
mvn ep-core-tool:request-reindex
Using CLI:
epcoretool.bat request-reindex
Example output:
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
[INFO] ------------------------------------------------------------------------
[INFO] Building ep-core-tool Maven Mojo
[INFO] task-segment: [ep-core-tool:request-reindex]
[INFO] ------------------------------------------------------------------------
[INFO] [ep-core-tool:request-reindex {execution: default-cli}]
[INFO] Created notification that product requires a rebuild.
[INFO] Created notification that cmuser requires a rebuild.
[INFO] Created notification that category requires a rebuild.
[INFO] Created notification that shippingservicelevel requires a rebuild.
[INFO] Created notification that promotion requires a rebuild.
[INFO] Created notification that customer requires a rebuild.
[INFO] Created notification that sku requires a rebuild.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
With the-Dwait=true
argument, the maven plugin will return only after the rebuild is complete:
mvn ep-core-tool:request-reindex -Dwait=true
EP Core Tool Command Line Application
The index wait functionality is unavailable for the EP Core Tool Command Line Application.
$ mvn ep-core-tool:request-reindex -Dwait=true
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
[INFO] ------------------------------------------------------------------------
[INFO] Building ep-core-tool Maven Mojo
[INFO] task-segment: [ep-core-tool:request-reindex]
[INFO] ------------------------------------------------------------------------
[INFO] [ep-core-tool:request-reindex {execution: default-cli}]
[INFO] Created notification that product requires a rebuild.
[INFO] Created notification that cmuser requires a rebuild.
[INFO] Created notification that category requires a rebuild.
[INFO] Created notification that shippingservicelevel requires a rebuild.
[INFO] Created notification that order requires a rebuild.
[INFO] Created notification that orderreturn requires a rebuild.
[INFO] Created notification that promotion requires a rebuild.
[INFO] Created notification that customer requires a rebuild.
[INFO] Created notification that sku requires a rebuild.
[INFO] Created notification that productassociation requires a rebuild.
[INFO] Indexes done: [category, customer, cmuser, shippingservicelevel] Waiting for: [product, promotion, sku]
[INFO] Indexes done: [category, customer, cmuser, shippingservicelevel, promotion] Waiting for: [product, sku]
[INFO] Indexes done: [category, customer, cmuser, shippingservicelevel, promotion, sku] Waiting for: [product]
[INFO] Indexes done: [category, customer, cmuser, shippingservicelevel, promotion, sku, product] Waiting for: []
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 25 seconds
Rebuild A Specific Index
To request a specific index to rebuild, use: -Dindex=index_type
$ mvn ep-core-tool:request-reindex -Dindex=category
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
[INFO] ------------------------------------------------------------------------
[INFO] Building ep-core-tool Maven Mojo
[INFO] task-segment: [ep-core-tool:request-reindex]
[INFO] ------------------------------------------------------------------------
[INFO] [ep-core-tool:request-reindex {execution: default-cli}]
[INFO] Created notification that category requires a rebuild.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
Checking Index Rebuild Status
Using Maven Plugin:
mvn ep-core-tool:index-status
Using CLI:
epcoretool.bat index-status
Example output:
$ mvn ep-core-tool:index-status
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
[INFO] ------------------------------------------------------------------------
[INFO] Building ep-core-tool Maven Mojo
[INFO] task-segment: [ep-core-tool:get-index-status]
[INFO] ------------------------------------------------------------------------
[INFO] [ep-core-tool:get-index-status {execution: default-cli}]
[INFO] category Tue Mar 22 17:12:58 PDT 2011 COMPLETE
[INFO] customer Tue Mar 22 17:12:58 PDT 2011 COMPLETE
[INFO] product Tue Mar 22 17:12:58 PDT 2011 COMPLETE
[INFO] promotion Tue Mar 22 17:12:59 PDT 2011 COMPLETE
[INFO] cmuser Tue Mar 22 17:12:59 PDT 2011 COMPLETE
[INFO] shippingservicelevel Tue Mar 22 17:12:59 PDT 2011 COMPLETE
[INFO] sku Tue Mar 22 17:12:59 PDT 2011 COMPLETE
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
Setting Elastic Path System Settings
You can use the ep-core-tool to set Elastic Path system configuration settings in place of the Commerce Manager.
Changing a single configuration setting
Using Maven Plugin:
mvn ep-core-tool:set-setting -DsettingName=setting -DsettingValue=VALUE
Using CLI:
$epcoretool.bat set-setting setting=value
$epcoretool.bat set-setting setting@context=value
Example output:
$ mvn ep-core-tool:set-setting -DsettingName=COMMERCE/SYSTEM/GEOIP/enable -DsettingValue=true
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
[INFO] ------------------------------------------------------------------------
[INFO] Building ep-core-tool Maven Mojo
[INFO] task-segment: [ep-core-tool:set-setting]
[INFO] ------------------------------------------------------------------------
[INFO] [ep-core-tool:set-setting {execution: default-cli}]
[INFO] Old Value: COMMERCE/SYSTEM/GEOIP/enable@null=false
[INFO] New Value: COMMERCE/SYSTEM/GEOIP/enable@null=true
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
To unset an individual value:
Using Maven Plugin:
mvn ep-core-tool:unset-setting -DsettingName=setting
Using CLI:
epcoretool.bat unset-setting setting
Change a group of system configuration settings
You can set a group of system configuration settings by modifying your settings.xml
file and running mvn ep-core-tool:bulk-set-settings
. To change a group of system configuration settings:
In your
settings.xml
file, insert the following block of code before the<profiles>
tag:<build> <plugin> <groupId>com.elasticpath.tools</groupId> <artifactId>ep-core-tool</artifactId> <executions> <execution> <goals> <goal>bulk-set-settings</goal> </goals> <configuration> <settings> </settings> </configuration> </execution> </executions> </plugin> <build>
Under
<settings>
, place your new configuration settings values.<build> <plugin> <groupId>com.elasticpath.tools</groupId> <artifactId>ep-core-tool</artifactId> <executions> <execution> <goals> <goal>bulk-set-settings</goal> </goals> <configuration> <settings> <setting>COMMERCE/SYSTEM/SEARCH/searchHost=${ep.search.url}</setting> <setting>COMMERCE/SYSTEM/ASSETS/assetLocation=${ep.local.asset.path}</setting> </settings> </configuration> </execution> </executions> </plugin> <build>
Run:
mvn ep-core-tool:bulk-set-settings
to change the values in your system.
ep-core-tool
help
Gets the list of available ep-core-tool commands:
$ mvn ep-core-tool:help
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
[INFO] ------------------------------------------------------------------------
[INFO] Building ep-core-tool Maven Mojo
[INFO] task-segment: [ep-core-tool:help] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [ep-core-tool:help {execution: default-cli}]
[INFO] com.elasticpath.tools:ep-core-tool:1.0-SNAPSHOT
ep-core-tool Maven Mojo
(no description available)
This plugin has 6 goals:
ep-core-tool:bulk-set-settings
Updates the setting value in the Elastic Path database. If a value already
exists, it will be removed before being re-added.
ep-core-tool:get-index-status
Display the current search server index rebuild status.
ep-core-tool:help
Display help information on ep-core-tool.
Call
mvn ep-core-tool:help -Ddetail=true -Dgoal=<goal-name>
to display parameter details.
ep-core-tool:request-reindex
Adds a rebuild request to the index notification queue.
ep-core-tool:set-setting
Updates the setting value in the Elastic Path database. If a value already
exists, it will be removed.
ep-core-tool:unset-setting
Updates the setting value in the Elastic Path database. If a value already
exists, it will be removed.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds