3

I have been trying to restore Sp site from our production environment to testing, for this purpose I have got the backup of production site and then copied to my testing environment.

Then I have created one new web application in testing environment and then one new publishing site (Site is working). After that I have started trying to restore the backup to recently created site in testing environment and I was using the following commands in SharePoint management shell. Restore-SPSite -Identity http://sp-test-web/sites/sseu -path E:\backup\spbr0001 -Force

after pressing enter this command is working fine and asked for Yes, No, etc. When I enter Y, I'm getting the following result.

Restore-SPSite : Access to the path 'E:\backup\spbr0001' is denied.
At line:1 char:1
+ Restore-SPSite -Identity http://sp-test-web/sites/seu -path
E:\backup\spbr0001 - ...

I did alot of research regarding this and followed different solutions that suggested but non are them working, NOTE: we have the same server and conifurations in Testing and production environment and I have given the access to the backuo folder to everyone

May I please know what would be the reason behind this error and why it's not working??

  • Is there no .bak file. I guess restore commands need .bak file. – P S Nov 29 '16 at 11:41
  • I have a folder where all the .bak files are available. is it necessary to have .bak file?? I tried to get .bak format but unfortunately its not getting, because I have taken the backup using CA. – Asrar Nov 29 '16 at 12:24
  • Do you have your copy on diffrent server not a SharePoint server maybe ? or this copy laying on SQL server ? – Michał Dem Nov 29 '16 at 13:15
  • Yes I do have the copy of the backup in a same server where I want to restore the site. – Asrar Nov 30 '16 at 6:21
0

Are you able to execute any other powershell scripts like "Get-SPWebApplication".

Couple of things you have to make sure is,

You can check the account is in the local administrator group on the machine. You can also check the local security policy, there you will find an option like prompt for consent while doing Run as Administrator.

Please see if it helps

  • Thanks for your response, Yes sir, I have tried, I can execute other commands easily, but while restoring I'm getting error. – Asrar Nov 29 '16 at 10:30
0

Can you check the backup folder and files are not in "read-only" state ?

if you can, set full control permissions on the folder to your service account and try again.

  • Dear sir my backup folder is in read only mode and it has full control to me and some other employees.. – Asrar Nov 30 '16 at 6:24
  • Did you try to unset the read only mode and run again the restore command ? – Matthieu Servien Nov 30 '16 at 15:52
  • Dear sir, Do you want me to make the folder as not read only mode and try it again? – Asrar Dec 1 '16 at 8:16
0
  • Remember to execute PowerShell as an Administrator.
  • Check if there's no another process accessing your .bak file.
  • Grant Full Control to the user whit whom you're executing PowerShell in the folder "E:\backup\spbr0001"
  • 1
    I have give full control to the backup folder, But today I will try using SP farm account, just to know is this problem occurred because of my account or what... – Asrar Nov 30 '16 at 6:23
  • Yes indeed. Everytime we do a Site restore here we use the farm account for this purpose. – Marcelo Espinosa Nov 30 '16 at 12:42
  • Oh sorry then, I certainly did not know about it, I will try using SP farm and Update you all. Thanks again for your support. – Asrar Dec 1 '16 at 7:19
  • 1
    Dear sir, I have tried using sp-farm account, but I'm still getting the same error i.e Access to the path is denied. do you have any idea why it's not working? – Asrar Dec 1 '16 at 8:18
  • 1
    I did sir, it's showing the same error. – Asrar Dec 4 '16 at 6:24
0

Few things to try:

  1. Open PowerShell window as an Administrator.
  2. Try some other location instead of E:\backup\spbr0001, that looks like something already being used by scheduled SharePoint backups.
  • Thanks for your quick response, No it's not like that, there is no backup will be performed on testing environment not ever performed, still I will check and update you. – Asrar Nov 29 '16 at 7:43
  • Dear sir, I have tried by changing the directory but still it's getting the same error. – Asrar Nov 29 '16 at 7:53
  • Did you try 1.? – Jussi Palo Nov 29 '16 at 9:15
  • Yes sir, It's not working Showing the same error message. – Asrar Nov 29 '16 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.