Not able to restore elastic search repository

Hi Experts,

          I want to restore elastic search index.

       Steps I had set path.repo path in elasticsearch.yml

       for eg:  path.repo: c:\bharath\repo\es-backup\.

      es-backup has the zip file named es-backup20170911.zip and its extracted zip as folder.

     set this path.repo then restart the elasticsearch service from windows services. it is sucessfull.

       I had tried both the paths c:\bharath\repo\es-backup  and C:\bharath\repo\es-backup\es-backup20170911\
     
     and restarted the elastic search service it has started properly.

     Next step is register the repository or import the respository in elasticsearch for that I had done the following step

    curl -XPUT 'http://localhost:9200/_snapshot/es_snap?verify=false&pretty' -d '{"type":"fs", "settings":{"location":"\\\\PC-ASSET-2\\Bharath\\Sourcecode\\project\\es-backup\\es_backup_20170911","compress":true}}'

       I  had tried changing PC-Asset-2 to c: I had tried both the options I get the following error below.  I had tried with single slash as well as double slashes in the location, I am not able to resolve this,  I am getting the below error.


      Invoke-WebRequest : Parameter cannot be processed because the parameter name 'd' is ambiguous. Possible matches
include: -DisableKeepAlive -Debug.
At line:1 char:74
+ curl -XPUT 'http://localhost:9200/_snapshot/es_snap?verify=false&pretty' -d '{"t ...
+                                                                          ~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameter,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

I had tried the same steps from postman with put and url is http://localhost:9200/_snapshot/es_snap?verify=false&pretty

Body raw with value '{"type":"fs", "settings":{"location":"C:\Bharath\Sourcecode\project\es-backup","compress":true}}' type text/plain

I get the following error 406 not acceptable.

Please help me in fixing this issue.

Once this step is complete ,  Do I have to do this command #curl -XPOST "localhost:9200/_snapshot/my_backup/snapshot_1/_restore?wait_for_completion=true"

it is mentioned in the documentation, is it right?

With Many Thanks,

Bharath AK
LVL 1
Bharath A.KAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bharath A.KAuthor Commented:
Hi All,

     I am able to resolve this.  The problem was I was trying it out on powershell and actual curl not installed and was not on the Path environmental variable.  I had downloaded curl and added that path to environment variable path.  Curl is working now.
secondly I had added absolute path to location  c:\\Bharath\\Sourcecode\\project\\es-backup\\es_backup_20170911 in data path, it started working with escape characters for double quotes.

With Many thanks,
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.