# Is possible to create multiple Stored Scripts in 1 single operation using the API?

**URL:** <https://discuss.elastic.co/t/is-possible-to-create-multiple-stored-scripts-in-1-single-operation-using-the-api/345680>\
**Category:** Elasticsearch\
**Created:** [October 24, 2023, 11:44pm UTC](https://discuss.elastic.co/t/is-possible-to-create-multiple-stored-scripts-in-1-single-operation-using-the-api/345680 "2023-10-24T23:44:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iTiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itiago/32/142800_2.png) [@iTiago](https://discuss.elastic.co/u/iTiago)\
**Post date:** [October 24, 2023, 11:44pm UTC](https://discuss.elastic.co/t/is-possible-to-create-multiple-stored-scripts-in-1-single-operation-using-the-api/345680/1 "2023-10-24T23:44:04Z")

</div>

I have more than 2.5K lines in StoredScripts in my old Cloud 5.6 cluster. I want to transfer them to my new Cloud 8.10.4 Cluster. For this, is there a way to automate the creation of these a little using the API?

I created the Scripts in the following way but I have more than 200 Scripts, do you think I should do it 1 by one? ☹

```auto
POST _scripts/ss_dashboard_1
{
  "script": {
    "lang": "mustache",
        "source": """{"aggregations":{"nivel":{"terms":{"field":"{{año}}{{mes}}.nivel.keyword"},"aggregations":{"tipo_cliente":{"terms":{"field":"{{año}}{{mes}}.tipo_cliente.keyword"}}}}}}""",
        "options": {
          "content_type": "application/json; charset=UTF-8"
  }
}
}

```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 25, 2023, 5:31am UTC](https://discuss.elastic.co/t/is-possible-to-create-multiple-stored-scripts-in-1-single-operation-using-the-api/345680/2 "2023-10-25T05:31:16Z")

</div>

There has been a lot of changes between version 5.6 and 8.10 so I suspect you will need to test each script to verify it still works. I would therefore recommend migrating and testing them all before simply uploading them and assuming they will continue to work.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 22, 2023, 5:31am UTC](https://discuss.elastic.co/t/is-possible-to-create-multiple-stored-scripts-in-1-single-operation-using-the-api/345680/3 "2023-11-22T05:31:21Z")

</div>

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