Reindex in place
editReindex in place
editYou can use the Upgrade Assistant in Kibana 6.8 to automatically reindex 5.x indices you need to carry forward to 7.9.3.
To manually reindex your old indices in place:
- Create an index with 7.x compatible mappings.
-
Set the
refresh_interval
to-1
and thenumber_of_replicas
to0
for efficient reindexing. -
Use the
reindex
API to copy documents from the 5.x index into the new index. You can use a script to perform any necessary modifications to the document data and metadata during reindexing. -
Reset the
refresh_interval
andnumber_of_replicas
to the values used in the old index. -
Wait for the index status to change to
green
. -
In a single update aliases request:
- Delete the old index.
- Add an alias with the old index name to the new index.
- Add any aliases that existed on the old index to the new index.
If you use machine learning features and your machine learning indices were created before 6.x, you must temporarily halt the tasks associated with your machine learning jobs and datafeeds and prevent new jobs from opening during the reindex. Use the set upgrade mode API or stop all datafeeds and close all machine learning jobs.
If you use Elasticsearch security features, before you reindex .security*
internal
indices it is a good idea to create a temporary superuser account in the file
realm.
-
On a single node, add a temporary superuser account to the
file
realm. For example, run the elasticsearch-users useradd command:bin/elasticsearch-users useradd <user_name> \ -p <password> -r superuser
-
Use these credentials when you reindex the
.security*
index. That is to say, use them to log into Kibana and run the Upgrade Assistant or to call the reindex API. You can use your regular administration credentials to reindex the other internal indices. -
Delete the temporary superuser account from the file realm. For example, run the elasticsearch-users userdel command:
bin/elasticsearch-users userdel <user_name>
For more information, see File-based user authentication.