Summary
Question
This article provides the steps for moving Elasticsearch data from the existing Elasticsearch environment on version 2.4.x on one machine to the newly installed Elasticsearch 5.6.x on another machine.
Elasticsearch is a required database component for ALM Octane. Elasticsearch version 5.6.x is required for ALM Octane 12.55.25 and later.
This article is relevant for
Answer
Please perform backup (take snapshot) of the current Elasticsearch data prior to moving any assets from one machine to another.
Prerequisites
Install Elasticsearch on a new machine according to the KM02494295
Both old and new Elasticsearch environments should be up and running before the migration.
Migration Steps
- On the new Elasticsearch machine, add new parameter to the elasticsearch.yml
(Linux: /etc/elasticsearch/elasticsearch.yml, Windows: %ES_HOME% \config/elasticsearch.yml)
reindex.remote.whitelist: 'MyOldElasticMachine:9200'
-
Restart Elasticsearch
-
Stop Octane service if it is still running
- Change the Elasticsearch configuration in the setup.xml file:
<Octane Installation folder>/conf/setup.xml
Update the elastic host parameter to new one: <elasticHost>NewElasticHost</elasticHost>
if cluster name changed, please update as follows: <elasticClusterName>NewClusterName</elasticClusterName>
Elasticsearch port stays the same - 9300
- Get the logical name of the space from the database by executing this SQL query:
select sp_logical_name from <octane_site_admin schema>.shared_space
NOTE: if you have many spaces in your Octane environment, you can get multiple lines in response
- Octane indexes in Elasticsearch are kept in the form of mqm_<logical name>_index
- Run these command FOR EACH logical space name from the existing Elasticsearch to copy the index to the new Elasticsearch environment:
curl –XPOST "MyNewElasticMachine:9200/_reindex?pretty" -H 'Content-Type: application/json' -d'
{
"source": {
"remote": {
"host": "http://MyOldElasticMachine:9200"
},
"index": "mqm_<Logical name from DB>_index"
},
"dest": {
"index": "mqm_<Logical name from DB>_index"
}
}
'
- Afterwards, need to configure the alias in the new Elasticsearch FOR EACH logical space name:
curl -XPOST "MyNewElasticMachine:9200/_aliases?pretty" -H 'Content-Type: application/json' -d'
{
"actions" : [
{ "add" : { "index" : "mqm_<Logical name from DB>_index", "alias" : "mqm_<Logical name from DB>" } }
]
}
'
- Restart Octane