1

I tried to take sp 2013 web application backup

I have used following command in sp management shell

Backup-SPFarm -Directory 'E:\SePortal_Bak\se.bak' -BackupMethod full -Item 'SEU Portal - 443' -Verbose

But I'm getting an error that Directory E:.... does not exist or the sql server permissions....

Is there any alternative way to get all the web application in only one .bak file??

Please if yes then kindly tell me..

Thanks in advance

2

If you are in multi-server farm environment then One of the requirement for the backup-Spfarm is UNC path. Both SharePoint farm and SQL Server service account should have read and write access to the path.

In the backup-spfarm, you dont need to provide the .bak rather you have to give folder. you cannot generate the single bak file, single bak file only when you run the backup-spsite.

Another alternate for web application backup & restore is.

  • take the backup( SQL BackUp) of the content database of the Web application
  • move the files to test farm
  • Restore the SQL backup in SQL server
  • Create web application in Test farm
  • Now attach that restore Database to the web application
  • Thank you so much sir, I have taken the backup from Production env using powershell, so I will try it for now to restore in testing env. – Asrar Dec 26 '16 at 5:31
2

Backup-spfarm -Directory parameter expects a directory (folder), not a filename with .bak extension.

Unlike the backup-spsite command which is going to output one .bak file, the result of the backup for a single web application is going to be a group of .bak files, which is what you're having now, which is the expected thing.

Note, from the definition of Restore-SPFarm command:

Restore-SPFarm -Directory <String> -ShowTree <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-BackupId <Guid>] [-ConfigurationOnly <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Item <String>] [-WhatIf [<SwitchParameter>]]

It expects a directory (folder) as well, where the package is stored (the .bak files from backup).

For more information:

https://technet.microsoft.com/en-us/library/ff607783.aspx

https://technet.microsoft.com/en-us/library/ff607881.aspx

1

Regarding the error

  • E:.... does not exist exist

    • If you have a computer on which SQL Server and an instance of SharePoint Products are installed, you can use local drive paths.
    • if SQL Server and SharePoint Products are installed on multiple computers or if you have multiple servers running SharePoint Products, you must use Universal Naming Convention (UNC) for example, (\\computer_name\volume\Backup).
  • or The SQL server permissions

    • Make sure you have run the SharePoint PowerShell as farm account or a user account have securityadmin fixed server role on the SQL Server instance and db_owner fixed database role on all databases that are to be updated.

For more details check Back up web applications in SharePoint 2013

Regarding Is there any alternative way to get all the web application in only one .bak file??

No only one item (web application) via bak file, also, if you tried to backup multiple web application via Central Administration you will be allowed only to select one web application otherwise you will need to select entire farm

  • Dear sir, Thank you so much for such brief information. I have taken backup using powershell, Will try to restore it now in testing environment. I will update you the results soon. – Asrar Dec 26 '16 at 5: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.