'Elasticsearch-dsl python migration - upgrading major versions

Based on Elasticsearch DSL docs (https://elasticsearch-dsl.readthedocs.io/en/latest/)

"you have to use a matching major version" of the library for compatibility. Specifically:

For Elasticsearch 7.0 and later, use the major version 7 (7.x.y) of the library.

For Elasticsearch 6.0 and later, use the major version 6 (6.x.y) of the library.

What's the best practice then for upgrading from ES 6 to ES 7? This seems to imply that you can't make your code forward compatible with ES 7 server without making it backwards incompatible with an ES 6 server at the same time.

I'm trying to avoid having two different versions of the code having to exist at the same time by making it forwards compatible in-place first, before upgrading the server. Has anyone done this? (We have lots of analyzers, tokenizers, multiple Documents, etc that we really don't want to have to duplicate in the code in the middle of the migration.)



Solution 1:[1]

There's an upgrade path that you need to follow. There's no need to maintain two different code bases. You should first make sure to upgrade to the latest minor+patch version of the ES 6 releases (i.e. 6.7 or 6.8) and make sure your indexes are compatible with that version.

You should also migrate your clients to the same latest minor+patch version of the ES 6 release, as Elastic makes sure that that version is forward-compatible with the next major version (i.e. ES 7).

Once you've tested everything on ES 6.7/6.8 (and properly backed up your data), you can safely upgrade to ES 7 and your clients will continue to work. Once ES is upgraded, you can upgrade your client to ES 7 as well.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Val