Changing elasticsearch FS repository path

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

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

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

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:

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...

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

@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) ?

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

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

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