Upgrading to Elasticsearch 8
7.4 U81+, 7.3 U31+
Elasticsearch 8 is supported and recommended for the latest Liferay 7.4 Update and GA release out of the box. For specific version compatibility details, refer to the Search Engine Compatibility Matrix.
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 7 server (or cluster) to Elasticsearch 8,
-
Back up the application specific indexes for Search Tuning (Synonym Sets and Result Rankings).
-
If you’re using X-Pack security, it’s enabled by default in Elasticsearch 8. To disable it, add this property:
xpack.security.enabled: false
See Securing Elasticsearch for detailed coverage of the security configuration.
-
Configure the Elasticsearch connection.
NoteThe bundled connector for Elasticsearch 7 is used to connect to Elasticsearch 8 through Elasticsearch’s REST API compatibility. See the connector reference guide for the applicable System Settings and configuration file names.
-
Restart Liferay, then reindex all search and spell check indexes.
NoteIf you performed a rolling upgrade, reindexing is not necessary.
-
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, doing a rolling upgrade is the recommended way to upgrade your Elasticsearch cluster as it minimizes downtime and eliminates the need to reindex all your data. 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.
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.
-
If you’ve performed a full cluster restart upgrade, you must reindex the company, system, and spell check indexes. From the Global Menu (), navigate to Control Panel → Configuration → Search. Click Execute for the Reindex All Search Indexes entry.
-
If you’ve performed a full cluster restart upgrade, you must 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.