sodcalculator

10 Tech How-To

Fix 0x80070005 SharePoint Restore Errors

Guide 10-51100 · Updated · Step by step

This guide walks you through fixing error 0x80070005 (Access Denied) when restoring a SharePoint site or content database. This error typically appears because the account running the restore lacks the necessary permissions, or because a file is locked or read-only. The steps below cover the most common causes and their fixes, from checking permissions to using the correct PowerShell commands.

What You’ll Need

  • Administrator access to the SharePoint server and the SQL Server instance hosting the content database.
  • SharePoint Management Shell (available on the server where SharePoint is installed).
  • SQL Server Management Studio (SSMS) or access to SQL Server via command line.
  • The backup file you are trying to restore (e.g., a .bak file or a site collection backup).
  • Credentials for an account that is a member of the db_owner role on the target content database.

Step-by-Step

  1. Identify the exact restore method you are using. Error 0x80070005 appears in several contexts: restoring a site collection via Central Administration, restoring a content database via SQL Server, or using PowerShell restore commands. The fix differs slightly, so note which method you are using.
  2. Verify the service account has the right SQL permissions. The account running the SharePoint Timer Service (or the account you are using to run the restore) must have db_owner or at least dbcreator permissions on the SQL Server instance. Open SQL Server Management Studio, right-click the target database, go to Properties → Permissions, and confirm the account is listed with the correct role. If not, add it.
  3. Check the file system permissions on the backup file. The backup file (e.g., backup.bak) must be readable by the account performing the restore. Right-click the file, go to Properties → Security, and ensure the account has Read permission. If the file is on a network share, also check the share permissions.
  4. Make sure the backup file is not read-only or locked. Right-click the backup file, go to Properties, and uncheck Read-only if it is checked. Also ensure no other process (like an antivirus scan or another restore) is holding the file open. If necessary, copy the file to a local temp folder and try again.
  5. If restoring a site collection via Central Administration: Go to Central Administration → Backup and Restore → Restore from a backup. Choose the correct backup job, then on the “Select Component to Restore” page, select the site collection. On the “Restore Options” page, choose the target site collection URL. Ensure the account running the restore has Full Control permission on the Web application and the target site collection. If not, add the account via Central Administration → Application Management → Manage Web Applications → select the web app → User Policy → Add Users.
  6. If restoring a content database via SQL Server: Open SSMS, connect to the SQL instance, right-click the target database, select Tasks → Restore → Database. Choose the source backup file. In the “Options” page, check Overwrite the existing database (WITH REPLACE) and ensure the target data file paths are correct. Before restoring, you may need to take the database offline or set it to single-user mode: right-click the database → Tasks → Take Offline. After restore, bring it back online.
  7. If using PowerShell: Open SharePoint Management Shell as Administrator. Use the Restore-SPFarm cmdlet for farm-level restores or Restore-SPSite for site collection backups. Example for a site collection:
    Restore-SPSite -Identity "http://sharepoint/sites/site1" -Path "C:\backups\site1.bak" -Force

    Make sure the account running the shell has the necessary SQL and SharePoint permissions (see step 2).

  8. Check the SharePoint ULS logs for more details. If the error persists, look at the Unified Logging Service (ULS) logs located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\LOGS. Search for the timestamp of the failure and look for lines containing “0x80070005” or “Access Denied”. The log may reveal which specific resource or permission is missing.
  9. Restart the SharePoint Timer Service and IIS. After making permission changes, restart the Timer Service (Services.msc → SharePoint 2016 Timer → Restart) and run iisreset from a command prompt to clear cached permissions.
  10. Retry the restore. After applying the fixes above, attempt the restore again. If it succeeds, you may need to run a site collection health check or re-index the search content if the restore was for a search service application.

Common Mistakes

  • Using the wrong account. Many users try to restore with their own domain account, which may not have SQL permissions. Always use the farm service account or an account explicitly granted db_owner.
  • Forgetting the WITH REPLACE option. When restoring a database that already exists, SQL Server will fail with access denied unless you explicitly overwrite it. Always check the “Overwrite the existing database” checkbox.
  • Ignoring the file path. If the backup file is on a mapped drive, the SQL Server service account may not see the same drive mapping. Use a UNC path (e.g., \\server\share\backup.bak) instead.
  • Skipping the “Take Offline” step. If the content database is in use, the restore will fail. Taking it offline first avoids locking issues.
  • Not checking the web application’s application pool identity. The application pool account must have read access to the backup file if you are restoring via Central Administration.

Tips

  • Use a dedicated restore account. Create a service account specifically for backups and restores, and grant it the minimum required permissions (db_owner on the content databases, read access to backup folders).
  • Test restores in a staging environment. Before performing a critical restore in production, test the same steps on a non-production server to ensure permissions are correctly configured.
  • Document your backup file locations. Keep all backup files in a central folder with clear permissions, and ensure the SQL Server service account has read access to that folder.
  • Use the SharePoint Central Administration “Restore from a backup” wizard. It handles many permission checks automatically and is less error-prone than manual SQL restores for site collections.
  • Keep the farm account in the local Administrators group on the SQL server. This is often required for restore operations, though it is a broader permission than strictly necessary.

Troubleshooting

If you have followed all the steps and still see the error, try these additional checks:

  • Check if the target site collection already exists. If you are restoring a site collection to a URL that already has content, the restore will fail. Delete the existing site collection first or use the -Force parameter in PowerShell.
  • Verify the SQL Server service account has permission to write to the data directory. The SQL Server service account needs Full Control on the folder where the .mdf and .ldf files are located. Check the folder permissions in Windows Explorer.
  • Look for orphaned jobs. Sometimes a stuck timer job can hold a lock. Run Get-SPTimerJob in PowerShell and check for any job stuck in a “Running” state. Restart the Timer Service if needed.
  • Check the SQL Server error log. In SSMS, expand “Management” → “SQL Server Logs” and look for errors around the restore time. This can reveal if the issue is at the SQL level, such as a corrupted backup file.
  • Try a different backup file. If the backup file itself is corrupted or incomplete, you may get access denied errors. Test the file by restoring it to a different database name (e.g., Restore-SPSite -Identity "http://sharepoint/sites/test" -Path "C:\backups\site1.bak" -Force).
  • If all else fails, run the restore from the command line with elevated privileges. Open a command prompt as Administrator and run the restore using stsadm.exe (for older versions) or PowerShell. This bypasses any UI permission restrictions.

Frequently Asked Questions

Q: Can I fix error 0x80070005 by just giving myself Full Control on the site collection?
A: No. The error is usually at the SQL or file system level, not the site collection level. You need SQL permissions and file access for the account performing the restore.

Q: Does the backup file need to be in a specific location?
A: Not necessarily, but it must be accessible by the SQL Server service account. A local path on the SQL server is safest. Network shares require the SQL service account to have read access to that share.

Q: Why do I get this error when restoring via Central Administration but not via SQL?
A: Central Administration uses the SharePoint Timer Service account, which may not have the same SQL permissions as the account you use in SSMS. Check the Timer Service account’s permissions on the content database.

Q: Is it safe to use the -Force parameter in PowerShell?
A: Yes, -Force overwrites the existing site collection without prompting. It is safe as long as you are sure you want to replace the current content with the backup.

Q: How do I find out which account is causing the problem?
A: Check the ULS logs for the exact account that failed. You can also run Get-SPServiceApplicationPool to see the identity of the application pool, and Get-SPTimerService to see the Timer Service account.

Q: Can this error be caused by a full disk on the SQL server?
A: Yes, if the disk is full, SQL Server cannot write the restored files and may return an access denied error. Check the available disk space on the drive where the database files are stored.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →