# Reindex large index

**URL:** <https://discuss.elastic.co/t/reindex-large-index/356450>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [March 29, 2024, 9:26am UTC](https://discuss.elastic.co/t/reindex-large-index/356450 "2024-03-29T09:26:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abkrim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abkrim/32/20217_2.png) [@abkrim](https://discuss.elastic.co/u/abkrim)\
**Post date:** [March 29, 2024, 9:26am UTC](https://discuss.elastic.co/t/reindex-large-index/356450/1 "2024-03-29T09:26:53Z")

</div>

Today I was faced with a reindex due to a question of deleting a field, plus a change in the mapping of the datetime field that I had planned.

I have done it with PHP.

42 million docs passed, even though the process lasted about 35 minutes.

Between that time, 2,600 docs were leaked or missing, which I estimate are from the sending of data that my system produces every 15 minutes (control of lighting systems command panels), that is, a complete process and part of another.

Locally I had tried executing the same command so that the docs that were added in a batch would be reindexed.

And it worked,

In the first test I did, (without changing the alias to point to the new index) I got this problem

```json
{
	"index": "analyzers-2024032501",
	"id": "P0boPIcBtSrsmCHcKSl6",
	"cause": {
		"type": "cluster_block_exception",
		"reason": "index [analyzers-2024032501] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"
	},
	"status": 429
}

```

In addition, the hard drive reached a size limit that did not correspond. It is as if instead of updating the NOT indexed ones, duplicates have been added.

```php
$params = [
            'body' => [
                'source' => [
                    'index' => $old,
                ],
                'dest' => [
                    'index' => $newIndexName,
                ],
            ],
        ];

        $this->info("Reindexing from $old to $mapping");
        try {
            $response = $this->client->reindex($params);
            $this->info("Reindex end from $old to $mapping");
        } catch (ClientResponseException|ServerResponseException $e) {
            $this->error("Error reindexing: {$e->getMessage()}");
            exit;
        }

```

## Questions

- can I re-run the same process? (Now alias work-analyzers point to `newIndexName` and this is production)

- There re run the same method?

---

<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:** [April 26, 2024, 9:27am UTC](https://discuss.elastic.co/t/reindex-large-index/356450/2 "2024-04-26T09:27:08Z")

</div>

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