Loading

Prepare to upgrade

Elastic Stack ECE ECK Elastic Cloud Hosted Self Managed

Before you upgrade, review and complete the necessary preparation steps, which vary by version.

Important

Upgrading from a release candidate build, such as 9.0.0-rc1, is unsupported. Use pre-releases only for testing in a temporary environment.

To upgrade from 8.17.0 or earlier to 9.0.0, you must first upgrade to the latest 8.18 patch release. This allows you to use the Upgrade Assistant to identify and resolve issues, reindex indices created before 8.0.0, and perform a rolling upgrade. Upgrading to the latest 8.18 patch release is required even if you choose a full Elasticsearch cluster restart. If you're using 7.x and earlier, you may need to complete multiple upgrades or perform a full-cluster restart to reach the latest 8.18 patch release before upgrading to 9.0.0.

Alternatively, you can create a 9.0 deployment and reindex from remote. For more information, refer to Reindex to upgrade.

Note

For flexible upgrade scheduling, 8.18.0 Beats and Logstash are compatible with 9.0.0 Elasticsearch. By default, 8.x Elasticsearch clients are compatible with 9.0.0 and use REST API compatibility to maintain compatibility with the 9.0.0 Elasticsearch server.

Review the following best practices to upgrade your deployments.

  1. Run the Upgrade Assistant, which identifies deprecated settings in your configuration and guides you through resolving issues that could prevent a successful upgrade. The Upgrade Assistant also helps resolve issues with older indices created before version 8.0.0, providing the option to reindex older indices or mark them as read-only. To prevent upgrade failures, we strongly recommend you do not skip this step.

    Note

    Depending on your setup, reindexing can change your indices, and you may need to update alerts, transforms, or other code targeting the old index.

  2. Before you change configurations or reindex, ensure you have a current snapshot.

    Tip

    Tip: In 8.3.0 and later, snapshots are generally available as simple archives. Use the archive functionality to search snapshots from 5.0.0 and later without needing an old Elasticsearch cluster. This ensures that your Elasticsearch data remains accessible after upgrading, without requiring a reindex process.

    To successfully upgrade, resolve all critical issues. If you make additional changes, create a snapshot to back up your data.

  3. To identify if your applications use unsupported features or behave differently in 9.0.0, review the deprecation logs in the Upgrade Assistant.

  4. Major version upgrades can include breaking changes that require additional steps to ensure your applications function as expected. Review the breaking changes for each product you use to learn more about potential impacts on your application. Ensure you test with the new version before upgrading existing deployments.

  5. Make the recommended changes to ensure your clients continue operating as expected after the upgrade.

    Note

    As a temporary solution, use the 8.x syntax to submit requests to 9.0.0 with REST API compatibility mode. While this allows you to submit requests using the old syntax, it doesn’t guarantee the same behavior. REST API compatibility should serve as a bridge during the upgrade, not a long-term solution. For more details on how to effectively use REST API compatibility during an upgrade, refer to REST API compatibility.

  6. If you use Elasticsearch plugins, ensure each plugin is compatible with the Elasticsearch version you're upgrading.

  7. Before upgrading your production deployment, we recommend creating a 9.0.0 test deployment and testing the upgrade in an isolated environment. Ensure the test and production environments use the same settings.

    Important

    After you upgrade, you cannot downgrade Elasticsearch nodes. If you can't complete the upgrade process, you must restore from the snapshot.

  8. If you use a separate monitoring cluster, upgrade the monitoring cluster before the production cluster. The monitoring cluster and the clusters being monitored should be running the same version of the Elastic Stack. Monitoring clusters cannot monitor production clusters running newer versions of the Elastic Stack. If necessary, the monitoring cluster can monitor production clusters running the latest release of the previous major version.

    Note

    If you use cross-cluster search, 9.0.0 and later can search only remote clusters running the previous minor version, the same version, or a newer minor version in the same major version. For more information, refer to Cross-cluster search.

    If you use cross-cluster replication, a cluster that contains follower indices must run the same or newer (compatible) version as the remote cluster. For more information and to view the version compatibility matrix, refer to Cross-cluster replication. To view your remote clusters in Kibana, go to Stack Management > Remote Clusters.

    In addition, if you have CCR data streams, refer to Upgrade uni-directional cross-cluster replication clusters with followed data streams for specific instructions on reindexing.

  9. To reduce overhead on the cluster during the upgrade, close machine learning jobs. Although machine learning jobs can run during a rolling upgrade, doing so increases the cluster workload.

  10. If you have .ml-anomalies-*anomaly detection result indices created in Elasticsearch 7.x, reindex them, mark them as read-only, or delete them before you upgrade to 9.0.0. For more information, refer to Migrate anomaly detection results.

  11. If you have transform destination indices created in Elasticsearch 7.x, reset, reindex, or delete them before you upgrade to 9.0.0. For more information, refer to Migrate transform destination indices.

Optionally create a 9.0.0 deployment and reindex from remote:

  1. Provision an additional deployment running 9.0.0.
  2. To reindex your data into the new Elasticsearch cluster, use the reindex documents API and temporarily send new index requests to both clusters.
  3. Verify the new cluster performs as expected, fix any problems, and then permanently swap in the new cluster.
  4. Delete the old deployment. On Elastic Cloud, you are billed only for the time the new deployment runs in parallel with your old deployment. Usage is billed on an hourly basis.

When moving to a new major version of Elasticsearch, you must perform specific actions to ensure that indices — including those that back a data stream — are compatible with the latest Lucene version. With a CCR-enabled cluster, consider whether you want to keep your older data writable or read-only to ensure you make changes to the cluster in the correct order.

Note

CCR-replicated data streams only allow writing to the most recent backing index, as ILM automatically injects an unfollow event after every rollover. Therefore, you can't reindex CCR-followed data streams since older backing indices are no longer replicated by CCR.

If you want to keep your older data as read-only:

  1. Issue a rollover for all replicated data streams on the follower cluster to ensure the write index is compatible with the version you're upgrading to.
  2. Run the Upgrade Assistant on the CCR follower cluster and resolve any data stream deprecation notices, selecting the option to not reindex and allow the backing indices to become read-only after upgrading.
  3. Upgrade the CCR follower cluster to the appropriate version. Ensure you take a snapshot before starting the upgrade.
  4. Run the Upgrade Assistant on the CCR leader cluster and repeat the same steps as the follower cluster, opting not to reindex.
  5. Upgrade the leader cluster and ensure CCR replication is healthy.

If you need to write directly to non-write backing indices of data streams in a CCR-replicated cluster pair:

  1. Before upgrading, remove the data stream and all follower indices from the CCR follower.
  2. Run the Upgrade Assistant and select the “Reindex” option.
  3. Once the reindexing is complete and the leader cluster is upgraded, re-add the newly reindexed backing indexes as follower indices on the CCR follower.

Reindex, mark as read-only, or delete the .ml-anomalies-* anomaly detection result indices created in Elasticsearch 7.x.

Reindex: While anomaly detection results are being reindexed, jobs continue to run and process new data. You cannot delete an anomaly detection job that stores results in the index until the reindexing is complete.

Mark indices as read-only: This is useful for large indexes that contain the results of one or two anomaly detection jobs. If you delete these jobs later, you cannot create a new job with the same name.

Delete: Delete jobs that are no longer needed in the Machine Learning app in Kibana. The result index is deleted when all jobs that store results in it have been deleted.

The transform destination indices created in Elasticsearch 7.x must be either reset, reindexed, or deleted before upgrading to 9.x.

Resetting: You can reset the transform to delete all state, checkpoints, and the destination index (if it was created by the transform). The next time you start the transform, it will reprocess all data from the source index, creating a new destination index in Elasticsearch 8.x compatible with 9.x. However, if data had been deleted from the source index, you will lose all previously computed results that had been stored in the destination index.

Reindexing: You can reindex the destination index and then update the transform to write to the new destination index. This is useful if there are results that you want to retain that may not exist in the source index. To prevent the transform and reindex tasks from conflicting with one another, you can either pause the transform while the reindex runs, or write to the new destination index while the reindex backfills old results.

Deleting: You can delete any transform that's no longer being used. Once the transform is deleted, you can delete the destination index or make it read-only.