Fix Cannot Open Backup Device Errors in SQL Server
In this article
The "cannot open backup device" error in SQL Server means the engine cannot create or write to the file path you gave it. The fix is almost always one of three things: the folder does not exist, the SQL Server service account lacks write permission to it, or the path is wrong for the server (for example, a local path used on a remote instance). Work through the checks below in order and you will usually clear it in a few minutes.
What You'll Need
- Administrative access to the SQL Server machine (or the ability to ask whoever runs it).
- The exact error message, including the operating system error number if one is shown (for example, error 5 or error 3).
- SQL Server Management Studio (SSMS) or another client that can run T-SQL.
- A login with permission to run backups on the target database.
Step-by-Step
- Read the full error text. SQL Server usually appends an operating system error. Error 3 means the path was not found; error 5 means access denied. That single number tells you which of the steps below matters most, so do not skip it.
- Confirm the path exists on the server, not on your PC. If you are connected to a remote instance, a path like C:\Backups refers to the server's C: drive. Check it there, not on your workstation.
- Create the folder if it is missing. Backup does not create directories. Make the folder in File Explorer on the server, or create it with a command you are comfortable with, then retry.
- Find the SQL Server service account. Open SQL Server Configuration Manager, select SQL Server Services, and look at the "Log On As" column for your instance. It is often a virtual account such as NT Service\MSSQLSERVER or a domain account.
- Grant that account write permission on the folder. Right-click the folder, choose Properties > Security > Edit > Add, type the service account name, and give it Modify or Full control. Apply to the folder and its contents.
- Check the path syntax in your BACKUP statement. Use a full path with the correct extension, for example BACKUP DATABASE MyDb TO DISK = 'C:\Backups\MyDb.bak'. A missing backslash, a trailing space, or a relative path will fail.
- Verify the database name and file name. A typo in the database name produces a different error, but a typo in the file path produces this one. Copy the path from the folder's address bar to avoid mistakes.
- Retry the backup. If it still fails, run the statement again and note whether the error number changed. A change from 3 to 5 means you fixed the path and now have a permission problem.
- Test with a simple path. As a diagnostic, try backing up to a folder you know the service account can write to, such as the default backup directory shown in server properties. If that works, the problem is specific to your original folder.
- Check disk space and file locks. A full disk or an existing file locked by antivirus can also block creation. Free space and exclude the backup folder from real-time scanning if your policy allows.
Common Mistakes
- Granting permission to your own user account. The backup runs as the SQL Server service account, not as you. Permissions must be on that account.
- Using a mapped drive. Mapped drives are per-user and often invisible to the service. Use a UNC path such as \\\\server\\share\\folder or a local path instead.
- Assuming a network share works without change. For a share, the service account needs share permission and NTFS permission, and the account must be able to authenticate to that server.
- Forgetting that backup does not create folders. The directory must already exist before the statement runs.
- Ignoring the operating system error number. It is the fastest clue you have; skipping it leads to guessing.
Tips
- Keep backup paths short and free of spaces or special characters to avoid quoting problems.
- Use a dedicated backup folder rather than a user profile folder, which may be cleaned up or restricted.
- Record the service account name somewhere handy; you will need it again for restores and maintenance plans.
- When scripting, use the full path every time rather than relying on the default directory.
- If you use a maintenance plan or agent job, confirm the job runs under an account that also has access to the path.
Troubleshooting
If the backup still fails after the steps above, work from the simplest checks outward. First, confirm the SQL Server service is running and that you are connected to the instance you think you are. Second, try the backup from a query window with a minimal statement to rule out tool-specific issues. Third, check the SQL Server error log and the Windows Event Viewer for a matching entry; they often name the exact account and path that failed.
If the error mentions access denied even after you granted permission, sign out and back in is not enough for the service: restart the SQL Server service so it picks up the new permissions, then retry. If the path is on a network share, test access from the server itself using the service account context if you can, or ask your network team to confirm share and NTFS permissions. If the disk is full, free space before retrying. If a file with the same name already exists and is locked, choose a new file name or close whatever is holding it.
When nothing works, fall back to the default backup directory. If a backup there succeeds, the issue is confined to your custom folder and its permissions, which narrows the investigation considerably.
Frequently Asked Questions
Why does the error say access denied when I am an administrator?
Because the backup runs under the SQL Server service account, not your Windows login. Grant that account permission on the folder.
Can I back up to a mapped drive?
Usually not reliably. Mapped drives are tied to a user session and the service may not see them. Use a UNC path or a local folder instead.
Does SQL Server create the backup folder automatically?
No. The folder must exist before the backup statement runs.
What does operating system error 3 mean?
It means the path was not found. Check the spelling and confirm the folder exists on the server.
What does operating system error 5 mean?
It means access denied. The service account lacks permission to the folder or file.
Do I need to restart SQL Server after changing folder permissions?
It is the safest way to make sure the service picks up the new permissions. Restart the service, then retry the backup.