Hello Team,
I am new to Elasticsearch I have an situation where I want to reindex data from elasticsearch to opensearch
I dont have any cluster so its a single node I wan some clarity on my below queries
-
How to export data that can be imported to opensearch (something like export to json and import in opensearch)
-
what if I copy data from /elasticsearch/nodes/0/indices/* to /opensearch/nodes/0/indices/ and then run reindex like below will it work
curl 'localhost:9200/_cat/indices?v'|awk '{print $3}'| tail -n +2 |sort | grep -v .geoip_databases >> oldindex.txt
ES_HOST="localhost"
ES_PORT="9200"
NEW_INDEX="-new"
for index in `cat oldindex.txt | grep gl-system-events_*`
do
newindex=$index${NEW_INDEX}
echo "Reindex process starting for index: $index to $newindex"
curl -X PUT "${ES_HOST}:${ES_PORT}/$newindex" -H 'Content-Type: application/json' -d @/pl/jsons/gl-system-events-new.json
echo "New index: $index-new created"
echo "Starting reindexing elastic data from original index:$index to new index:$newindex"
curl -s -X POST "${ES_HOST}:${ES_PORT}/_reindex" -H 'Content-Type: application/json' -d'
{
"source": {
"index": "'$index'"
},
"dest": {
"index": "'$newindex'"
}
}'
echo "Reindexing completed from original index:$index to new index:$newindex"
done;
I cant do remote reindexing want some help where we can do manual dump/export which can be imported in opensearch.
Please guide.
Regards,
SAM