Upgrading to Elasticsearch 8
7.4 U81+, 7.3 U31+
Elasticsearch 8 is supported and recommended for the latest Liferay DXP Quarterly and Portal 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.
- It’s possible to install a new Elasticsearch cluster and connect to the upgraded Liferay, but some data can be lost if the Elasticsearch cluster contained indexes used as primary storage, like the indexes for Liferay’s Search Tuning features in Liferay DXP 7.2 and 7.3. See Backing Up and Restoring Search Tuning Indexes for Liferay 7.2 and 7.3 and Importing the Search Tuning Indexes in 7.4..
To upgrade an existing Elasticsearch 7 server (or cluster) to Elasticsearch 8,
-
Back up all Liferay indexes. Depending on your system and your version, you may need to back up additional indexes. See Backing Up Elasticsearch.
-
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; if necessary, 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, 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 use the snapshot and restore approach to backup your indexes, you can also avoid reindexing. However, whenever you upgrade Liferay alongside Elasticsearch, you must always reindex to account for mappings and settings changes.
If you’ve installed a new Elasticsearch server, you can restore most Liferay indexes by triggering a full or concurrent reindex from the UI, once the Liferay database is upgraded.
On Liferay 7.2/7.3, the Search Tuning (Result Rankings and Synonyms) indexes and any custom indexes are not backed by database storage. These indexes must be restored from a snapshot of the pre-upgrade indexes if setting up a new Elasticsearch server for Liferay 7.2/7.3 or when upgrading from Liferay 7.2/7.3 and setting up a new Elasticsearch server.
Restart Liferay and Reindex
Once Liferay is connected with the Elasticsearch cluster, run a full or concurrent reindex to bring the Liferay data into the new Elasticsearch installation. In some cases a reindex may not be needed:
Upgrade Scenario | Reindex Required |
---|---|
Liferay upgraded Elasticsearch not upgraded | ✔ |
Liferay upgraded Elasticsearch upgraded | ✔ |
Elasticsearch upgraded using a rolling restart Liferay not upgraded | ✘ |
Elasticsearch upgraded using a full cluster restart Liferay not upgraded | ✘ |
Elasticsearch installed from scratch; indexes were not restored | ✔ |
-
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.