Backup indices

I tested the snapshot feature and restoration with this doc:

. It works perfectly.

I have still two questions:

  1. how to make a snapshot of the structure indices, therefore without the data.

  2. when I restore the snapshot, scripted fields are not restored.
    How can I include it in the snapshot?


  1. You don't need snapshot and restore for that. Just run something like GET index/_mapping and save the JSON document you are getting back.

  2. No idea... :slight_smile: Actually I don't think you can. Script fields are computed dynamically when running a search query. So just run the same queries you used to run...

When I create a new indice structure, I start my logstash configuration with the binary, then in Indice, I create the new Indice. After I add manualy the scripted fields.
So, if I export the json, how can I reimport it in Elasticsearch ?

1 Like

I found how I can create a indices in command line (

WIth a other command like GET index/_mapping , we can get scripted fields configuration to backup in a json file ?

1 Like