# Sync 2 indices in the same cluster

**URL:** <https://discuss.elastic.co/t/sync-2-indices-in-the-same-cluster/359926>\
**Category:** Elasticsearch\
**Created:** [May 21, 2024, 1:36pm UTC](https://discuss.elastic.co/t/sync-2-indices-in-the-same-cluster/359926 "2024-05-21T13:36:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielR1](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@DanielR1](https://discuss.elastic.co/u/DanielR1)\
**Post date:** [May 21, 2024, 1:36pm UTC](https://discuss.elastic.co/t/sync-2-indices-in-the-same-cluster/359926/1 "2024-05-21T13:36:58Z")

</div>

Hello!

Is there a way to keep in sync two elasticsearch indices?  
Whatever is written by the app in one index, to be copied in a second index.  
It is not a viable solution to make the app writing at the same time to both indices(or to kafka).

Thanks!

---

<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:** [May 21, 2024, 1:45pm UTC](https://discuss.elastic.co/t/sync-2-indices-in-the-same-cluster/359926/2 "2024-05-21T13:45:26Z")

</div>

> [@DanielR1](#):
>
> Is there a way to keep in sync two elasticsearch indices?  
> Whatever is written by the app in one index, to be copied in a second index.

As far as I know there is nothing to support this within Elasticsearch.

> [@DanielR1](#):
>
> It is not a viable solution to make the app writing at the same time to both indices(or to kafka).

This is what I would have suggested. Why is this not an option?

---

<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:** [May 21, 2024, 2:08pm UTC](https://discuss.elastic.co/t/sync-2-indices-in-the-same-cluster/359926/3 "2024-05-21T14:08:38Z")

</div>

Is that within the same cluster? Otherwise look at [Cross-cluster replication | Elasticsearch Guide [8.13] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-ccr.html)

---

<div class="post-metadata">

**Author:** ![DanielR1](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@DanielR1](https://discuss.elastic.co/u/DanielR1)\
**Post date:** [May 22, 2024, 7:39am UTC](https://discuss.elastic.co/t/sync-2-indices-in-the-same-cluster/359926/4 "2024-05-22T07:39:22Z")

</div>

Hello! Thank you for your answers.

It is not an option for now because it would imply pretty high additional hardware costs.

It is in the same cluster.

Thanks

---

<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:** [May 22, 2024, 7:53am UTC](https://discuss.elastic.co/t/sync-2-indices-in-the-same-cluster/359926/5 "2024-05-22T07:53:04Z")

</div>

So what's the use case? May be we can suggest another solution to solve this.

---

<div class="post-metadata">

**Author:** ![rakes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakes/32/141133_2.png) [@rakes](https://discuss.elastic.co/u/rakes)\
**Post date:** [June 5, 2025, 3:22pm UTC](https://discuss.elastic.co/t/sync-2-indices-in-the-same-cluster/359926/6 "2025-06-05T15:22:46Z")

</div>

When we create a connector, let's say postgresql for example , the index is defined by default and i didn't see option to add a custom index over a connector.

Is this default behavior that the index is preconfigured?  
As I need a different index over the same connector, I am not able to find any such way to do this. If I have to reindex again and again that would simply be a overhead of syncing docs between indexes.

I am a beginner and any kind of help is appreciated.

Thank you.

---

<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:** [June 5, 2025, 3:35pm UTC](https://discuss.elastic.co/t/sync-2-indices-in-the-same-cluster/359926/7 "2025-06-05T15:35:03Z")

</div>

Short answer: use an alias. That's immediate.  
I believe that you can set the index name you want but I'm not that familiar with the connectors.
