# Cross Cluster Replication for existing indexes

**URL:** <https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515>\
**Category:** Elasticsearch\
**Tags:** ccr-cross-cluster-replication\
**Created:** [May 27, 2023, 10:39pm UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515 "2023-05-27T22:39:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vvsh](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vvsh](https://discuss.elastic.co/u/vvsh)\
**Post date:** [May 27, 2023, 10:39pm UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/1 "2023-05-27T22:39:22Z")

</div>

Hello!

I am considering CCR as a tool to migrate all the data (including historical data) from a source Elasticsearch single-node cluster to a target Elasticsearch multi-node cluster (both clusters have 7.17.7 version).

The existing cluster was created 3 years ago and now it has ~1TB of data and 20+ indices. All indices have index.soft\_deletes.enabled = true.

After reading the documentation of CCR, it looks like it relies on shard history retention.

My question is that if I start creating follower indices now, will CCR replicate all the data from the source cluster, or only new data will be replicated that will be ingested after the follower indexes are created?

- If all data will be replicated, is there any chance that any of the records will be lost?
- if not, should I create new indices with `index.soft_deletes.retention_lease.period` equals, for example, to 30/90 days, perform reindexing, and then use new indices as leader indices for CCR?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 28, 2023, 11:19pm UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/2 "2023-05-28T23:19:44Z")

</div>

Welcome to our community! 😃

Why not do a remote reindex if you are looking to migrate?

---

<div class="post-metadata">

**Author:** ![vvsh](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vvsh](https://discuss.elastic.co/u/vvsh)\
**Post date:** [May 29, 2023, 8:18am UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/3 "2023-05-29T08:18:12Z")

</div>

The main issue with reindexing is that some of the indexes have over 1B of the documents, however the maintenance window is very short (max 4 hours). It also means that we will have to reindex all 20 indices in less than 4 hours, otherwise the application will not be able to operate.

My plan was to setup CCR replication and when all the data will be replicated, perform the cutover.

---

<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 29, 2023, 8:33am UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/4 "2023-05-29T08:33:25Z")

</div>

Are all 20 indices continously indexed into?

---

<div class="post-metadata">

**Author:** ![vvsh](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vvsh](https://discuss.elastic.co/u/vvsh)\
**Post date:** [May 29, 2023, 11:45am UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/5 "2023-05-29T11:45:54Z")

</div>

Yes, we are using Elasticsearch as a search engine for application data.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [May 29, 2023, 12:16pm UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/6 "2023-05-29T12:16:09Z")

</div>

> [@vvsh](#):
>
> Yes, we are using Elasticsearch as a search engine for application data.

Also, do you have a platinum license for both of your clusters? CCR needs a paid license in both clusters.

---

<div class="post-metadata">

**Author:** ![vvsh](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vvsh](https://discuss.elastic.co/u/vvsh)\
**Post date:** [May 29, 2023, 12:37pm UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/7 "2023-05-29T12:37:15Z")

</div>

Yes, we will have a license on both clusters, however, I hope that the replication will not take more than 1 month, so we will be able to decommission the old cluster quickly after that.

---

<div class="post-metadata">

**Author:** ![vvsh](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vvsh](https://discuss.elastic.co/u/vvsh)\
**Post date:** [June 1, 2023, 3:49pm UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/8 "2023-06-01T15:49:22Z")

</div>

@leandrojmp, @Christian_Dahlqvist, @warkolm, Do you know if this approach is going to work at all or do I need to start looking into other options (reindexing or custom solutions)?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 1, 2023, 3:58pm UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/9 "2023-06-01T15:58:53Z")

</div>

In theory it should work, the only way to know is by testing it.

I do not use CCR, so not sure what may happen.

---

<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:** [June 29, 2023, 3:59pm UTC](https://discuss.elastic.co/t/cross-cluster-replication-for-existing-indexes/334515/10 "2023-06-29T15:59:41Z")

</div>

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