Upgrading to Elasticsearch 7
7.1 and 7.2
Liferay 7.3 and 7.4 support Elasticsearch 7 out of the box. To find the latest available search engine version for your Liferay installation, see the Search Engine Compatibility Matrix.
For Liferay 7.2, Elasticsearch 7 is supported via the Liferay Connector to Elasticsearch 7 (version 3.x
). If you’re upgrading to Liferay 7.3+ or bringing your existing 7.2 search engine to Elasticsearch 7, you must upgrade your Elasticsearch servers. To set up a new Liferay 7.2 system, install Elasticsearch 7 and follow the installation guide.
Before upgrading Elasticsearch, back up your existing data. If something goes wrong during or after the upgrade, roll back to the previous version using the uncorrupted index snapshots. Follow the steps in Backing up Elasticsearch.
To upgrade an existing Elasticsearch server (or cluster) to Elasticsearch 7,
-
Back up the application specific indexes for Search Tuning (Synonym Sets and Result Rankings).
-
If you’re using X-Pack security, make sure it’s enabled:
xpack.security.enabled: true
See Securing Elasticsearch for detailed coverage of the security configuration.
-
[7.2 only] Blacklist the bundled Liferay Connector to Elasticsearch 6 and install the Connector to Elasticsearch 7.
-
Configure the Connector to Elasticsearch 7 to connect to Elasticsearch.
-
Restart Liferay, then reindex all search and spell check indexes.
-
Restore Search Tuning indexes from the snapshot. If you were previously using these features, you may have data stored in these indexes.
-
Verify that Search Tuning entries have been carried over.
Upgrading Elasticsearch
If you are using a rolling-restart eligible version (6.8.x
), doing a rolling upgrade is the recommended way to upgrade your Elasticsearch cluster. Otherwise, follow the full cluster restart upgrade guide.
If you’ve installed a new Elasticsearch server and want to index your pre-upgrade data, most Liferay indexes can be restored by triggering a reindex from the UI, once the Liferay database is upgraded. However, the Search Tuning (Result Rankings and Synonyms) indexes and any custom indexes not backed by database storage must be restored from a snapshot of the pre-upgrade indexes.
Blacklisting Elasticsearch 6
This is only necessary if running Liferay 7.2.
-
Create a configuration file named
com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration.config
-
Give it these contents:
blacklistBundleSymbolicNames=[ \ "com.liferay.portal.search.elasticsearch6.api", \ "com.liferay.portal.search.elasticsearch6.impl", \ "com.liferay.portal.search.elasticsearch6.spi", \ "com.liferay.portal.search.elasticsearch6.xpack.security.impl", \ "Liferay Connector to X-Pack Security [Elastic Stack 6.x] - Impl", \ "Liferay Enterprise Search Security - Impl" \ ]
-
Deploy the file by copying it to your server’s
deploy
folder.
Restart Liferay and Reindex
Once Liferay is connected with the Elasticsearch cluster, restart Liferay and reindex the applicable indexes into the new Elasticsearch installation:
-
Restart Liferay.
-
Reindex the company, system, and spell check indexes. From the Global Menu (), navigate to Control Panel → Configuration → Search. Click Reindex for the All Search Indexes entry.
-
Reindex the Workflow Metrics indexes: from the Global Menu (), navigate to Applications → Workflow—Metrics. Open the Settings menu ( and Click Reindex All. Repeat the process for each Virtual Instance.
This restores the indexes built from data stored in the Liferay database. To restore indexes used as primary storage, see Backing Up Elasticsearch.
Liferay 7.2: Reverting to Elasticsearch 6
Stuff happens. If you’re on Liferay 7.2 and that stuff involves an unrecoverable failure during the upgrade to Elasticsearch 7, you can roll back to Elasticsearch 6 and regroup.
Since your Elasticsearch 6 and 7 are currently two separate installations, this procedure takes only a few steps:
-
Stop the Liferay Connector to Elasticsearch 7.
-
Stop Elasticsearch 7 and make sure that the Elasticsearch 6
elasticsearch.yml
and the connector app are configured to use the same port (9200 by default). -
Remove the blacklist configuration file for Elasticsearch 6 from your installation’s
osgi
folder. -
Start the Elasticsearch server and then restart the Liferay Connector to Elasticsearch 6.
Once your upgrade is completed, see the new search features available in your Liferay version..