# Changing elasticsearch FS repository path

**URL:** <https://discuss.elastic.co/t/changing-elasticsearch-fs-repository-path/310658>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [July 26, 2022, 2:48pm UTC](https://discuss.elastic.co/t/changing-elasticsearch-fs-repository-path/310658 "2022-07-26T14:48:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amirmono](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@amirmono](https://discuss.elastic.co/u/amirmono)\
**Post date:** [July 26, 2022, 2:48pm UTC](https://discuss.elastic.co/t/changing-elasticsearch-fs-repository-path/310658/1 "2022-07-26T14:48:14Z")

</div>

I'm using elastiSearch 8.3 on a windows machine, and created a shared file system repository - my\_repo:

```auto
PUT _snapshot/my_repo
    {
      "type": "fs",
      "settings": {
        "location": "relative_path"        
      }
    }

```

The base path for this repository is set in the .yml file:

```auto
path.repo: \\path1\path1

```

If I'm changing the path in the .yml file (to e.g. \path2\path2), restart elastic and trying to recreate/update the my\_repo:

```auto
PUT _snapshot/my_repo
{
  "type": "fs",
  "settings": {
    "location": "relative_path"        
  }
}

```

I'm getting an error:

> "[my\_repo] Could not read repository data because the contents of the repository do not match its expected state. This is likely the result of either concurrently modifying the contents of the repository by a process other than this cluster or an issue with the repository's underlying storage. The repository has been disabled to prevent corrupting its contents. To re-enable it and continue using it please remove the repository from the cluster and add it again to make the cluster recover the known state of the repository from its physical contents."

Only if I'm changing back to the previuos path (\path1\path1) and set my\_repo to `readonly = true` I can than change the path (\path2\path2) and update the repository.

I know that only one cluster can register the repository for write, but here I have only one cluster...

---

<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:** [July 27, 2022, 11:48pm UTC](https://discuss.elastic.co/t/changing-elasticsearch-fs-repository-path/310658/2 "2022-07-27T23:48:02Z")

</div>

> [@amirmono](#):
>
> If I'm changing the path in the .yml file (to e.g. \path2\path2)

Are you moving the existing repository items there, or is this a completely new repo path?

---

<div class="post-metadata">

**Author:** ![amirmono](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@amirmono](https://discuss.elastic.co/u/amirmono)\
**Post date:** [July 28, 2022, 7:54am UTC](https://discuss.elastic.co/t/changing-elasticsearch-fs-repository-path/310658/3 "2022-07-28T07:54:54Z")

</div>

@warkolm Actually, I'm not sure... how do I move the existing items? just copy-paste everything or sould I use the API (I'm not using kibana)?  
If it is a completely new repo, will I be able to restore somehow in the future from snapshots in the old repo (e.g. - If I'll create a new repo with the old path) ?

---

<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:** [July 28, 2022, 10:18am UTC](https://discuss.elastic.co/t/changing-elasticsearch-fs-repository-path/310658/4 "2022-07-28T10:18:27Z")

</div>

Ok let's take a step back, why are you wanting to make these changes?

---

<div class="post-metadata">

**Author:** ![amirmono](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@amirmono](https://discuss.elastic.co/u/amirmono)\
**Post date:** [July 28, 2022, 11:26am UTC](https://discuss.elastic.co/t/changing-elasticsearch-fs-repository-path/310658/5 "2022-07-28T11:26:15Z")

</div>

I have an App which saves dava in elastic and has a SLM policy that take snapshots every hour and saves it in repository X (shared fs repo). The client of my app defines the path to this repository and I want to give him the option to change it (the path) in the future

---

<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:** [August 25, 2022, 11:26am UTC](https://discuss.elastic.co/t/changing-elasticsearch-fs-repository-path/310658/6 "2022-08-25T11:26:44Z")

</div>

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