DevOps migration guide 202001.0

Edit on GitHub

This document covers all the maintenance related details that a DevOps engineer would want to know to keep a Spryker project up to date with the latest release changes.

The 202001.0 release introduces the following updates:

  • Elasticsearch version
  • PHP version
  • Health checks
  • Routing
  • Console commands
  • Twig cache location
  • Translation cache location

Elasticsearch 6.0

The latest supported version of Elasticsearch is upgraded to version 6.0.

To enable Elasticsearch 6.0:

  1. Install Elasticsearch 6 as described.
  2. Run the commands to set up new indexes and generate corresponding index map classes:
console search:setup:sources
console search:setup:source-map

The first command creates empty indexes that follow the new index structure - an index per each old mapping type. The second one generates index map classes for the new indexes.

These commands do not remove the existing indexes suffixed with _search. The search data contained in the existing indexes is migrated to the new ones in the next step.

The following environment configuration constants are deprecated:

Deprecated with replacement:

\Spryker\Shared\Search\SearchConstants::FULL_TEXT_BOOSTED_BOOSTING_VALUE
\Spryker\Shared\Search\SearchConstants::ELASTICA_PARAMETER__HOST
\Spryker\Shared\Search\SearchConstants::ELASTICA_PARAMETER__PORT
\Spryker\Shared\Search\SearchConstants::ELASTICA_PARAMETER__TRANSPORT
\Spryker\Shared\Search\SearchConstants::ELASTICA_PARAMETER__AUTH_HEADER
\Spryker\Shared\Search\SearchConstants::ELASTICA_PARAMETER__EXTRA
\Spryker\Shared\Search\SearchConstants::ELASTICA_CLIENT_CONFIGURATION
\Spryker\Shared\Search\SearchConstants::DIRECTORY_PERMISSION

Deprecated without replacement:

\Spryker\Shared\Search\SearchConstants::ELASTICA_PARAMETER__INDEX_NAME
\Spryker\Shared\Search\SearchConstants::ELASTICA_PARAMETER__DOCUMENT_TYPE
\Spryker\Shared\Search\SearchConstants::SEARCH_INDEX_NAME_SUFFIX

Find the corresponding substitutions below:

\Spryker\Shared\SearchElasticsearch\SearchElasticsearchConstants::FULL_TEXT_BOOSTED_BOOSTING_VALUE
\Spryker\Shared\SearchElasticsearch\SearchElasticsearchConstants::HOST
\Spryker\Shared\SearchElasticsearch\SearchElasticsearchConstants::PORT
\Spryker\Shared\SearchElasticsearch\SearchElasticsearchConstants::TRANSPORT
\Spryker\Shared\SearchElasticsearch\SearchElasticsearchConstants::AUTH_HEADER
\Spryker\Shared\SearchElasticsearch\SearchElasticsearchConstants::EXTRA
\Spryker\Shared\SearchElasticsearch\SearchElasticsearchConstants::CLIENT_CONFIGURATION
\Spryker\Shared\SearchElasticsearch\SearchElasticsearchConstants::DIRECTORY_PERMISSION

We strongly recommend adding new configuration constants alongside the old ones before making any other changes in project files. You can remove the old constants from the configuration once the project code is adjusted - all the needed plugins are hooked and all modules are configured.

Data migration

Migrate all the search data from the old indexes to the new ones. The quickest way to do this is through the Elasticsearch Reindex API. Find an exemplary case of migrating data from the old de_search index to the new ones called de_page and de_product-review below:

POST _reindex
{
  "source": {
    "index": "de_search",
    "type": "page"
  },
  "dest": {
    "index": "de_page",
    "type": "page"
  }
}
POST _reindex
{
  "source": {
    "index": "de_search",
    "type": "product-review"
  },
  "dest": {
    "index": "de_product-review",
    "type": "product-review"
  }
}

In the example, the data belonging to page and product-review mapping types of the old de_search index is migrated to the two new dedicated indexes - de_page and de_product-review respectively. Do the same for all the other indexes/mapping types in your project.

Only after you make sure that all the search data is migrated, you can remove the old indexes.

PHP 7.1

PHP 7.1 is no longer supported. Update PHP version to 7.2 or higher.

Health checks

Heartbeat functionality was replaced with the Health checks functionality.

Enable heath checks by defining \Spryker\Shared\HealthCheck\HealthCheckConstants::HEALTH_CHECK_ENABLED = true in configuration.

The health-check/index path is used to check the status of each application.

Routing

As Silex has been replaced together with the Routing service provider, we introduced a new routing that implements router cache. To warm up the router cache, include vendor/bin/yves router:cache:warm-up and vendor/bin/console router:cache:warm-up into the deployment recipe.

Updated console commands

  • console transfer:generate was split into two commands:

    • console transfer:generate
    • console transfer:entity:generate In the deployment recipe, replace console transfer:generate with console transfer:entity:generate that is executed after console propel:model:build.
  • search:setup:indexes was split into two commands:

    • console search:setup:sources
    • console search:setup:source-map In the deployment recipe, replace console search:setup:indexeswith console search:setup:sourcesand console search:setup:source-map.

Twig cache location

Find the new paths to Twig cache directories below:

  • Yves - %s/data/%s/cache/YVES/twig/
  • Zed - %s/data/%s/cache/ZED/twig/

Translation cache location

The new path to Zed translation cache directory is %s/data/%s/cache/Zed/translation.