Elasticsearch upgrade from v2.3.4 to v6.1.1

Hi, I have a setup running elasticsearch v2.3.4, I want to upgrade it to v6.1.1 and I wanted to migrate all my data from v2.3.4 to v6.1.1. I followed all the steps suggested for this.

  1. 1st I upgraded by elasticsearch to v5.6.0
  2. The I created new Indexes with the new mapping type
  3. I Reindexed old index to the new index and the deleted the old index.
  4. At v5.6.0 all index and data is visible.
  5. But when I upgrade it to v6.1.1 (or v6.0.0) all my indexes goes missing.

I am not using any plugin like xpack. To debug this I also installed elasticsearch-migration plugin but then too at the end after upgrading to v6.x all my index are missin.
Appreciate the help.
Thanks

If you look on the filesystem are they still there?

Thanks for the reply, yes its is still available in the FS:
root@vatd:~# ls /var/lib/elasticsearch/elasticsearch/nodes/0/
indices node.lock _state

Which steps did you follow?

I followed the steps mentioned in the link:
https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade.html

Since my setup was on v2.3.4 I 1st installed v5.6.0. Also my datatypes were not compatible for v.6x (like I had 'string' datatype which has changed to 'text' and 'keyword') so I created new Index with the new datatype in my upgrade (v5.6.0) setup and re-indexed all my data from old index to the new index and deleted the old Indexes. Then I upgraded the setup with v6.0.0 after which my indexes are not visible:
on v5.6.0:
root@vatd:~# curl -4 -s -H 'Content-Type: application/json; charset=utf8' -u admin:root123 -X-XGET http://localhost:9200/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open tasks_v2 VunYoUIRRACHbC7nlJDKLA 1 1 12 0 21.1kb 21.1kb
yellow open engresults_v2 lJQDVjWPR-6qeOGTmdSGrg 1 1 5 0 5.6kb 5.6kb
yellow open twitter ZLWutujyTt-bQqGPNqNzow 5 1 1 0 5.2kb 5.2kb

Note: tasks_v2 and engresults_v2 is the reIndexed table carried from v2.3.4. twitter table was created to check if the table created in v5.6.0 retains.

then I uninstalled (v5.6.0) and installed(v6.0.0) elastic search (I even tried directly upgrade without uninstall:- stop service the upgrade):

rpm -e elasticsearch

rpm -Uvh elasticsearch-6.0.0.rpm

When the setup came up the index table is empty:
root@vatd:~# curl -4 -s -H 'Content-Type: application/json; charset=utf8' -u admin:root123 -X-XGET http://localhost:9200/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size

When I upgrade my setup directly from v5.6.0 (v2.3.4 was not installed on setup), then all data added in v5.6.0 is available after upgrade to v6.0.0.

There no ES cluster is there.

Did you run the Migration Assistant plugin as well?

Can you post your config?

I have even tried the migration tool (https://github.com/elastic/elasticsearch-migration/) which helped me check for upgrade from v.2.3.4 to v5.6.0 and this upgrade is working fine. The issue is happening with further v5.6.0 to v6.x for which that migration tool was not compatible. Do we have a migration tool for v5.6.0 to v6.x assistance too?

I dont have any thing changed in my configuration yml file. the default values which are enabled are:

Path to directory where to store the data (separate multiple locations by comma):

path.data: /var/lib/elasticsearch

Path to log files:

path.logs: /var/log/elasticsearch

Hi Mark,
Today I tried to make v2.3.4 -> v6.1.1 upgrade with a very basic setup. My setup was fresh and I installed v2.3.4, then added very basic entries in the index: twitter, then upgraded to v5.6.0 then v6.1.1. But the result was same. Has this upgrade worked for anyone?
Following are the commands which I have done on my setup without changing any default configuration:

1 wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/2.3.4/elasticsearch-2.3.4.rpm --no-check-certificate
2 rpm -Uvh elasticsearch-2.3.4.rpm
3 systemctl start elasticsearch.service
4 systemctl status elasticsearch.service
5 curl -XPUT 'localhost:9200/twitter/tweet/1?pretty' -H 'Content-Type: application/json' -d'
{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elasticsearch"
}
'
6 curl -XPUT 'localhost:9200/twitter/tweet/2?pretty' -H 'Content-Type: application/json' -d'
{
"user" : "kimchy2",
"post_date" : "2009-11-15T14:12:22",
"message" : "trying out Elasticsearch2"
}
'
7 curl -XGET 'http://localhost:9200/twitter/_count'
8 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.0.rpm --no-check-certificate
9 systemctl stop elasticsearch.service
10 systemctl status elasticsearch.service
11 systemctl status elasticsearch.service
12 rpm -Uvh elasticsearch-5.6.0.rpm
13 systemctl status elasticsearch.service
14 systemctl daemon-reload
15 systemctl start elasticsearch.service
16 systemctl status elasticsearch.service
17 curl -XGET 'http://localhost:9200/twitter/_count'
18 curl -XPOST 'localhost:9200/_reindex?pretty' -H 'Content-Type: application/json' -d'
{
"source": {
"index": "twitter"
},
"dest": {
"index": "twitter_v2"
},
"script":{
"inline":"ctx._parent = null;"
}
}'
19 curl -4 -s -H 'Content-Type: application/json; charset=utf8' -X-XGET http://localhost:9200/_cat/indices?v
20 curl -XGET 'http://localhost:9200/twitter_v2/_count'
21 curl -XDELETE 'http://localhost:9200/twitter/'
22 curl -4 -s -H 'Content-Type: application/json; charset=utf8' -X-XGET http://localhost:9200/_cat/indices?v
23 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.rpm --no-check-certificate
24 systemctl status elasticsearch.service
25 systemctl stop elasticsearch.service
26 systemctl status elasticsearch.service
27 rpm -Uvh elasticsearch-6.1.1.rpm
28 systemctl status elasticsearch.service
29 systemctl daemon-reload
30 systemctl start elasticsearch.service
31 systemctl status elasticsearch.service
32 curl -4 -s -H 'Content-Type: application/json; charset=utf8' -X-XGET http://localhost:9200/_cat/indices?v
33 history

If someone from the support can try these steps (it will take less then 5 mins to do above steps) and can tell me if any thin I have done wrong...

@vishal_kumar,

upgrading from 5.6.x to 6.x requires that you do some special steps. please install x-pack basic license for elasticsearch and kibana, and run the Upgrade Assistant which is in x-pack kibana. You are right, the migration tool was for going from 2 -> 5, but from 5 -> 6, we've created a similar tool in x-pack kibana, with the same features. You can do a cluster checkup to make sure you have no deprecated settings or mappings; you can run a reindex on all your old indices (shouldn't apply in your case if you've already reindexed in v5) as well as any internal indices (such as .kibana).

If you don't want to install x-pack, you need to follow our instructions on how to do all of this manually. You will very likely need to make some changes before you can upgrade to 6. all the steps on how to prepare your cluster for that upgrade can be found in our docs online. To get you started, follow this guide: https://www.elastic.co/products/upgrade_guide This will spit out a detailed list of upgrade steps based on your stack setup.

You can also dive right into this: https://www.elastic.co/guide/en/elastic-stack/6.0/upgrading-elastic-stack.html

We also have a webinar walking you through major parts of the upgrade here: https://www.elastic.co/webinars/upgrading-your-elastic-stack

elasticsearch upgrade is not going to work for following without a patch work:
v2.3.4 -> v5.6.0 -> v6.x

Reason:
The default datapath in v2.3.4 was '/var/lib/elasticsearch/elasticsearch/nodes'
The default datapath in 6.x is '/var/lib/elasticsearch/nodes'

When we follow upgrade sequence then after coming to 6.x the data files are still kept at '/var/lib/elasticsearch/elasticsearch/nodes' but the 6.x version is expecting to have data in '/var/lib/elasticsearch/nodes'. If I manually copy the data from '/var/lib/elasticsearch/elasticsearch/nodes' to '/var/lib/elasticsearch/nodes' before starting elasticsearch (v6.x) and the start elasticsearch then the data is available.

Please fix this issue in coming 6.x release. Fix is while instaling 6.x rpm check if any data is present in '/var/lib/elasticsearch/elasticsearch/nodes'. If yes move it to '/var/lib/elasticsearch/nodes'.

What is your clustername?

It is a standalone box. '# cluster.name: my-application' is commented in my configuration file.

If it's commented then it won't be applied.

'culster-name' commented shouldnt be the reason of data loss for v2.3.4->v5.6.0->v6.x upgrade.
Do we agree that there is an issue as commented in "Elasticsearch upgrade from v2.3.4 to v6.1.1" and need to be corrected?

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