Reindexing Elasticsearch 2.x to 5.x

Hi there,

i am upgrading our elasticsearch instance from 2.x to 5.6. The upgrade itself with full cluster restart went fine. Now i need to reindex all indices in order to upgrade to version 6.x.

I do not understand what is meant by reindexing all indices. Is it enough if i push our old backups from elasticdump or do we need to creat all indices new?

Regards,
Ahmet

Hi Ahmet,

There is an Upgrade Assistant tool available as part of XPack for Elasticsearch/Kibana 5.6. Please follow the instructions here or here. The Upgrade Assistant will allow you to detect any index and mapping issues that need to be resolved before upgrading to Elasticsearch 6.x. The assistant makes use of the Reindex API under the hood.

1 Like

Hi Magnus,
do i need to use Kibana for upgrading? I dont use this instance with Kibana.

Hi Magnus,
what i now tried is creating each index new. After that i set up my analyzer and mappings with elasticdump and reindexed all indices with _reindex. Is that correct?
/_xpack/migration/assistance does not show me my reindexed indices.

EDIT: I did now see that my mapping threw out some error. Does the _reindex copy my mappings too?

EDIT2: I now found out, that mappings are not copied during _reindex.

The [string] type is removed in 5.0 and automatic upgrade failed because parameters [term_vector] are not supported for automatic upgrades. You should now use either a [text] or [keyword] field instead for field [text]
I think i have to upgrade my mapping structure. right?

Hi again :slight_smile:
sorry for so many replies but i am trying to solve this as fast as possible.
I now downloaded kibana. It is now connected to my elasticsearch. But i cannot find the Upgrade Assistant button after i clicked on Management like described in this article: https://www.elastic.co/guide/en/kibana/5.6/xpack-upgrade-assistant.html

Hi Ahmet,

do i need to use Kibana for upgrading? I dont use this instance with Kibana.

Yes, the Upgrade Assistant is part of X-Pack for Kibana 5.6. Please ensure you've installed this into your Kibana instance, or else the upgrade assistant won't appear in the Management app.

what i now tried is creating each index new. After that i set up my analyzer and mappings with elasticdump and reindexed all indices with _reindex. Is that correct?

That is a valid alternative for upgrading. You can use the Reindex API to transfer index data from a remote Elasticsearch instance. This can also be used when the mapping has been changed. As you found out already, the Reindex API requires you to set up mappings for your new indices before ingesting any data, as otherwise the default mappings are being used. Comprehensive details about breaking changes are available in the documentation, but it largely boils down to converting any string fields to either text or keyword fields.

Therefore you should review your index mapping and create a version compatible with 5.x and 6.x (pay attention to not using multiple document types!), before upgrading.

3 Likes

Hi Magnus,

thank you so much :slight_smile:
In the meantime i downloaded kibana on the server and tried to reindex my indices. This is indeed a lot faster than the way i tried. Now i also got this error messages: Edit your mappings for this index before proceeding.
I will now try solving the issues.

Thank you very much. I think this thread can be marked as solved now :tada:

Regards,
Ahmet

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.