# How to Properly delete previous index before uploading a new one with different mapping

**URL:** <https://discuss.elastic.co/t/how-to-properly-delete-previous-index-before-uploading-a-new-one-with-different-mapping/166342>\
**Category:** Elasticsearch\
**Created:** [January 30, 2019, 11:38am UTC](https://discuss.elastic.co/t/how-to-properly-delete-previous-index-before-uploading-a-new-one-with-different-mapping/166342 "2019-01-30T11:38:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![examin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/examin/32/70688_2.png) [@examin](https://discuss.elastic.co/u/examin)\
**Post date:** [January 30, 2019, 11:38am UTC](https://discuss.elastic.co/t/how-to-properly-delete-previous-index-before-uploading-a-new-one-with-different-mapping/166342/1 "2019-01-30T11:38:11Z")

</div>

Many times when we change mapping or try to mutate some columns type , but then we get object mapping error. May be this happen because of not deleting properly last index. Then what steps must be kept in mind before again indexing data ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 30, 2019, 11:50am UTC](https://discuss.elastic.co/t/how-to-properly-delete-previous-index-before-uploading-a-new-one-with-different-mapping/166342/2 "2019-01-30T11:50:00Z")

</div>

To delete an index run:

```auto
DELETE your_index_name

```

It will remove everything including all data.

---

<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:** [February 27, 2019, 11:50am UTC](https://discuss.elastic.co/t/how-to-properly-delete-previous-index-before-uploading-a-new-one-with-different-mapping/166342/3 "2019-02-27T11:50:07Z")

</div>

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