Migrating only index structure from Elasticsearch

We are currently running Elasticsearch 7.17.0 and plan to migrate to opensearch (a opensearch service with the newest version is already running). Since we dont want to copy all the old data, but just ingest the new data to opensearch the only thing that has to be migrated are our indices and their structure (so no documents inside the indices). Each index has a template with a lifecycle policy, so migrating those templates should be enough.

Currently the only possibility i see would be to manually create them, this would take a long time though, is there a way to automate this e.g. by writing a script that reads the index templates from elasticsearch and creates them in opensearch?

Thank you very much!

Hello. I did the same thing and did it manually. Because while templates can theoretically be migrated with a script (it all depends on what settings you have), ILM in Elastic and ISM in Opensearch have many differences. This was a revelation for me when I started to delve into this issue. It is better to spend time doing a certain percentage manually and then if you see patterns, you can try to automate it.

Do you have a lot of templates?

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