Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This site contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Using the EP-Core-Tool

Using the 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 and an 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 core
  • ep-core-tool - Contains the maven plugin that depends on ep-core-tool-logic
  • ep-core-tool-cli - Contains the command line application that depends on ep-core-tool-logic

The ep-core-tool allows you to:

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:

  1. Set the production server's database details in: core\ep-core-tool-cli\src\main\resources\epcoretool.config
  2. From the command line, run mvn install in core\ep-core-tool-cli to build the tool.
  3. The application builds to: core\ep-core-tool-cli\target\ep-core-tool-cli-<VERSION>-bin.zip
  4. Transfer and unzip the file to a folder on your production server.
  5. Install your database's JDBC driver:
    1. Linux - set IE_CLASSPATH to the fully-qualified path and jar filename of your JDBC driver. For example, export IE_CLASSPATH=/home/ep/.m2/repository/mysql/mysql-connector-java/5.1.44/mysql-connector-java-5.1.44.jar
    2. Windows - drop the JDBC driver into your deployment's lib folder: ep-core-tool-cli-7.0.0-SNAPSHOT\lib
  6. 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:

  1. Set the production server's database details in your .m2/settings.xml file.
  2. Build the Maven Plugin to your production server's Maven repository.
  3. 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.

Changing Commerce Manager User Passwords

This Maven command updates Commerce Manager user passwords:

  1. mvn ep-core-tool:set-cmuser-password -Dusername="USER" -Dpassword="PASSWORD"

Copy

  1. epcoretool.bat set-cmuser-password user=password

Copy

Note:

The password must pass validation checks before it sets.

  1. $ mvn ep-core-tool:set-cmuser-password -Dusername="admin" -Dpassword="ep31337"
  2. [INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
  3. [INFO] ------------------------------------------------------------------------
  4. [INFO] Building EP Core Maven Plugin
  5. [INFO] task-segment: [ep-core-tool:set-cmuser-password]
  6. [INFO] ------------------------------------------------------------------------
  7. [INFO] [ep-core-tool:set-cmuser-password {execution: default-cli}]
  8. [INFO] ------------------------------------------------------------------------
  9. [INFO] BUILD SUCCESSFUL
  10. [INFO] ------------------------------------------------------------------------
  11. [INFO] Total time: 7 seconds

Copy

Pinging the Search Server

Ping the search server to discover the number of products that have been indexed.

  1. mvn ep-core-tool:ping-search

Copy

  1. epcoretool.bat ping-search

Copy

  1. [INFO] Scanning for projects...
  2. [INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
  3. [INFO] ------------------------------------------------------------------------
  4. [INFO] Building ep-core-tool Maven Mojo
  5. [INFO] task-segment: [ep-core-tool:ping-search]
  6. [INFO] ------------------------------------------------------------------------
  7. [INFO] Search service has 12481 products indexed in your default locale.
  8. [INFO] BUILD SUCCESSFUL

Copy

Rebuild Search Indexes

Rebuild All Indexes

To request all search server indexes to rebuild:

  1. mvn ep-core-tool:request-reindex

Copy

  1. epcoretool.bat request-reindex

Copy

  1. [INFO] Scanning for projects...
  2. [INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
  3. [INFO] ------------------------------------------------------------------------
  4. [INFO] Building ep-core-tool Maven Mojo
  5. [INFO] task-segment: [ep-core-tool:request-reindex]
  6. [INFO] ------------------------------------------------------------------------
  7. [INFO] [ep-core-tool:request-reindex {execution: default-cli}]
  8. [INFO] Created notification that product requires a rebuild.
  9. [INFO] Created notification that cmuser requires a rebuild.
  10. [INFO] Created notification that category requires a rebuild.
  11. [INFO] Created notification that shippingservicelevel requires a rebuild.
  12. [INFO] Created notification that promotion requires a rebuild.
  13. [INFO] Created notification that customer requires a rebuild.
  14. [INFO] Created notification that sku requires a rebuild.
  15. [INFO] ------------------------------------------------------------------------

Copy

...
Read more

With the -Dwait=true argument, the plugin will return only after the rebuild is complete:

  1. mvn ep-core-tool:request-reindex -Dwait=true

Copy

Note: EP Core Tool Command Line Application

The index wait functionality is unavailable for the EP Core Tool Command Line Application

  1. $ mvn ep-core-tool:request-reindex -Dwait=true
  2. [INFO] Scanning for projects...
  3. [INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
  4. [INFO] ------------------------------------------------------------------------
  5. [INFO] Building ep-core-tool Maven Mojo
  6. [INFO] task-segment: [ep-core-tool:request-reindex]
  7. [INFO] ------------------------------------------------------------------------
  8. [INFO] [ep-core-tool:request-reindex {execution: default-cli}]
  9. [INFO] Created notification that product requires a rebuild.
  10. [INFO] Created notification that cmuser requires a rebuild.
  11. [INFO] Created notification that category requires a rebuild.
  12. [INFO] Created notification that shippingservicelevel requires a rebuild.
  13. [INFO] Created notification that order requires a rebuild.
  14. [INFO] Created notification that orderreturn requires a rebuild.
  15. [INFO] Created notification that promotion requires a rebuild.

Copy

...
Read more

Rebuilding a Specific Index

To request a specific index to rebuild, use: -Dindex=index_type

  1. mvn ep-core-tool:request-reindex -Dindex=INDEX_TYPE

Copy

  1. $ mvn ep-core-tool:request-reindex -Dindex=category
  2. [INFO] Scanning for projects...
  3. [INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
  4. [INFO] ------------------------------------------------------------------------
  5. [INFO] Building ep-core-tool Maven Mojo
  6. [INFO] task-segment: [ep-core-tool:request-reindex]
  7. [INFO] ------------------------------------------------------------------------
  8. [INFO] [ep-core-tool:request-reindex {execution: default-cli}]
  9. [INFO] Created notification that category requires a rebuild.
  10. [INFO] ------------------------------------------------------------------------
  11. [INFO] BUILD SUCCESSFUL
  12. [INFO] ------------------------------------------------------------------------
  13. [INFO] Total time: 6 seconds

Copy

Checking Index Rebuild Status

  1. mvn ep-core-tool:index-status

Copy

  1. epcoretool.bat index-status

Copy

  1. $ mvn ep-core-tool:index-status
  2. [INFO] Scanning for projects...
  3. [INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
  4. [INFO] ------------------------------------------------------------------------
  5. [INFO] Building ep-core-tool Maven Mojo
  6. [INFO] task-segment: [ep-core-tool:get-index-status]
  7. [INFO] ------------------------------------------------------------------------
  8. [INFO] [ep-core-tool:get-index-status {execution: default-cli}]
  9. [INFO] category Tue Mar 22 17:12:58 PDT 2011 COMPLETE
  10. [INFO] customer Tue Mar 22 17:12:58 PDT 2011 COMPLETE
  11. [INFO] product Tue Mar 22 17:12:58 PDT 2011 COMPLETE
  12. [INFO] promotion Tue Mar 22 17:12:59 PDT 2011 COMPLETE
  13. [INFO] cmuser Tue Mar 22 17:12:59 PDT 2011 COMPLETE
  14. [INFO] shippingservicelevel Tue Mar 22 17:12:59 PDT 2011 COMPLETE
  15. [INFO] sku Tue Mar 22 17:12:59 PDT 2011 COMPLETE

Copy

...
Read more

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

To set a single system configuration setting

  1. mvn ep-core-tool:set-setting -DsettingName=setting -DsettingValue=VALUE

Copy

  1. epcoretool.bat set-setting setting=value

Copy

  1. epcoretool.bat set-setting setting@context=value

Copy

  1. $ mvn ep-core-tool:set-setting -DsettingName=COMMERCE/SYSTEM/GEOIP/enable -DsettingValue=true
  2. [INFO] Scanning for projects...
  3. [INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
  4. [INFO] ------------------------------------------------------------------------
  5. [INFO] Building ep-core-tool Maven Mojo
  6. [INFO] task-segment: [ep-core-tool:set-setting]
  7. [INFO] ------------------------------------------------------------------------
  8. [INFO] [ep-core-tool:set-setting {execution: default-cli}]
  9. [INFO] Old Value: COMMERCE/SYSTEM/GEOIP/enable@null=false
  10. [INFO] New Value: COMMERCE/SYSTEM/GEOIP/enable@null=true
  11. [INFO] ------------------------------------------------------------------------
  12. [INFO] BUILD SUCCESSFUL
  13. [INFO] ------------------------------------------------------------------------
  14. [INFO] Total time: 7 seconds

Copy

To unset an individual value:

  1. mvn ep-core-tool:unset-setting -DsettingName=setting

Copy

  1. epcoretool.bat unset-setting setting

Copy

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:

  1. In your settings.xml file, insert the following block of code before the <profiles> tag:
    1. <build>
    2. <plugin>
    3. <groupId>com.elasticpath.tools</groupId>
    4. <artifactId>ep-core-tool</artifactId>
    5. <executions>
    6. <execution>
    7. <goals>
    8. <goal>bulk-set-settings</goal>
    9. </goals>
    10. <configuration>
    11. <settings>
    12. </settings>
    13. </configuration>
    14. </execution>
    15. </executions>

    Copy

    ...
    Read more

  2. Under <settings>, place your new configuration settings values.
    1. <build>
    2. <plugin>
    3. <groupId>com.elasticpath.tools</groupId>
    4. <artifactId>ep-core-tool</artifactId>
    5. <executions>
    6. <execution>
    7. <goals>
    8. <goal>bulk-set-settings</goal>
    9. </goals>
    10. <configuration>
    11. <settings>
    12. <setting>COMMERCE/SYSTEM/SEARCH/searchHost=${ep.search.url}</setting>
    13. <setting>COMMERCE/SYSTEM/encryptionKey=${ep.encryptionKey}</setting>
    14. <setting>COMMERCE/SYSTEM/EMAIL/emailCmUrl=${ep.emailCmUrl}</setting>
    15. <setting>COMMERCE/SYSTEM/assetHttpHost=${ep.asset.http.host}</setting>

    Copy

    ...
    Read more

  3. 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:

  1. mvn ep-core-tool:help

Copy

  1. $ mvn ep-core-tool:help
  2. [INFO] Scanning for projects...
  3. [INFO] Searching repository for plugin with prefix: 'ep-core-tool'.
  4. [INFO] ------------------------------------------------------------------------
  5. [INFO] Building ep-core-tool Maven Mojo
  6. [INFO] task-segment: [ep-core-tool:help] (aggregator-style)
  7. [INFO] ------------------------------------------------------------------------
  8. [INFO] [ep-core-tool:help {execution: default-cli}]
  9. [INFO] com.elasticpath.tools:ep-core-tool:1.0-SNAPSHOT
  10. ep-core-tool Maven Mojo
  11. (no description available)
  12.  
  13. This plugin has 6 goals:
  14.  
  15. ep-core-tool:bulk-set-settings

Copy

...
Read more