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:
mvn ep-core-tool:ping-search
[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:
mvn ep-core-tool:request-reindex
[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 indexes and promotion rules have completed building:
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.
Update a single configuration setting value
Using Maven Plugin:
mvn ep-core-tool:set-setting -DsettingName=SETTING -DsettingValue=VALUE
mvn ep-core-tool:set-setting -DsettingName=SETTING -DsettingContext=CONTEXT -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
Update multiple configuration setting values
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:
Change to the extensions database folder of your Elastic Path source.
cd extensions/database
In the
pom.xml
file, insert the following block of code within the<build>
tag:<plugins> <plugin> <groupId>com.elasticpath.tools</groupId> <artifactId>ep-core-tool</artifactId> <executions> <execution> <phase>process-resources</phase> <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> </plugins>
Run the following command to change the values in your system:
mvn install
Update a single configuration setting metadata value
Using Maven Plugin:
mvn ep-core-tool:set-setting-metadata -DsettingName=SETTING -DmetadataName=METADATA_NAME -DmetadataValue=METADATA_VALUE
Using CLI:
epcoretool.bat set-setting-metadata SETTING@METADATA_NAME=METADATA_VALUE
Example output:
mvn ep-core-tool:set-setting-metadata -DsettingName=COMMERCE/SYSTEM/ONHOLD/holdAllOrdersForStore -DmetadataName=refreshStrategy -DmetadataValue=immediate
[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-metadata]
[INFO] ------------------------------------------------------------------------
[INFO] [ep-core-tool:set-setting-metadata {execution: default-cli}]
[INFO] Old Value: COMMERCE/SYSTEM/ONHOLD/holdAllOrdersForStore@refreshStrategy=interval:timeout=COMMERCE/Cache/Cache_1
[INFO] New Value: COMMERCE/SYSTEM/ONHOLD/holdAllOrdersForStore@refreshStrategy=immediate
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
Update multiple configuration setting metadata values
You can set a group of system configuration settings metadata values by modifying your settings.xml
file and running mvn ep-core-tool:bulk-set-setting-metadata
. To change a group of system configuration setting metadata values:
Change to the extensions database folder of your Elastic Path source.
cd extensions/database
In the
pom.xml
file, insert the following block of code within the<build>
tag:<plugins> <plugin> <groupId>com.elasticpath.tools</groupId> <artifactId>ep-core-tool</artifactId> <executions> <execution> <phase>process-resources</phase> <goals> <goal>bulk-set-setting-metadata</goal> </goals> <configuration> <settings> <setting>COMMERCE/SYSTEM/ONHOLD/holdAllOrdersForStore@refreshStrategy=immediate</setting> <setting>COMMERCE/SYSTEM/MESSAGING/DOMAIN/channelUri@refreshStrategy=immediate</setting> </settings> </configuration> </execution> </executions> </plugin> </plugins>
Run the following command to change the values in your system:
mvn install
ep-core-tool
help
Gets the list of available ep-core-tool commands:
mvn ep-core-tool:help