# Can I use rsync tool to migrate closed index on a running elasticsearch cluster?

**URL:** <https://discuss.elastic.co/t/can-i-use-rsync-tool-to-migrate-closed-index-on-a-running-elasticsearch-cluster/175194>\
**Category:** Elasticsearch\
**Created:** [April 3, 2019, 12:35pm UTC](https://discuss.elastic.co/t/can-i-use-rsync-tool-to-migrate-closed-index-on-a-running-elasticsearch-cluster/175194 "2019-04-03T12:35:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adminstrator](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adminstrator/32/42575_2.png) [@Adminstrator](https://discuss.elastic.co/u/Adminstrator)\
**Post date:** [April 3, 2019, 12:35pm UTC](https://discuss.elastic.co/t/can-i-use-rsync-tool-to-migrate-closed-index-on-a-running-elasticsearch-cluster/175194/1 "2019-04-03T12:35:02Z")

</div>

I have many closed indices to migrate.But I do not want to open them,then use node tag attribute to migrate them dynamicly.

```auto
[root@test ~]# curl -s 'localhost:9200/my_index/_settings?pretty'
{
  "my_index" : {
    "settings" : {
      "index" : {
        "routing" : {
          "allocation" : {
            "require" : {
              "tag" : "new"
            }
          }
        },
        "number_of_shards" : "8",
        "provided_name" : "my_index",
        "creation_date" : "1554289841101",
        "number_of_replicas" : "0",
        "uuid" : "h-czpwf0S9y5re8XYWHWtA",
        "version" : {
          "created" : "6030299"
        }
      }
    }
  }
}
```

I can get the uuid of the closed index by above command,and I found the 8 shards are staying several old es nodes.

Can i directly rsync the `/path.data/nodes/0/indices/h-czpwf0S9y5re8XYWHWtA/` files to the same directory on the new es nodes(it looks like forcing to rebalance the shards )?

I know this operation will make the shards meta data missing.But is it possiblely to use the moved file recovery directly?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 3, 2019, 12:42pm UTC](https://discuss.elastic.co/t/can-i-use-rsync-tool-to-migrate-closed-index-on-a-running-elasticsearch-cluster/175194/2 "2019-04-03T12:42:07Z")

</div>

> [@Adminstrator](#):
>
> Can i directly rsync the `/path.data/nodes/0/indices/h-czpwf0S9y5re8XYWHWtA/` files to the same directory on the new es nodes(it looks like forcing to rebalance the shards )?

No. Moving things around within the data folder is completely unsupported and risks data loss.

---

<div class="post-metadata">

**Author:** ![Adminstrator](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adminstrator/32/42575_2.png) [@Adminstrator](https://discuss.elastic.co/u/Adminstrator)\
**Post date:** [April 3, 2019, 1:27pm UTC](https://discuss.elastic.co/t/can-i-use-rsync-tool-to-migrate-closed-index-on-a-running-elasticsearch-cluster/175194/4 "2019-04-03T13:27:03Z")

</div>

> [@DavidTurner](#):
>
> No. Moving things around within the data folder is completely unsupported and risks data loss.

It's you too. Handsome David.

Got it ,I have more than 200TB data(exclude replications) to migrate.But can not stop the cluster. So the only way is using the tag attribute to migrate....

---

<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:** [May 1, 2019, 1:27pm UTC](https://discuss.elastic.co/t/can-i-use-rsync-tool-to-migrate-closed-index-on-a-running-elasticsearch-cluster/175194/5 "2019-05-01T13:27:18Z")

</div>

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