Published on

October 2, 2016

Fixing Property BackupDirectory is Not Available for Settings in SQL Server

As a SQL Server enthusiast, I often find that breaking things in my environment is a great way to learn. Recently, I encountered an error while trying to perform a database restore using a backup I had taken earlier. In this blog post, I will share how I resolved the issue of “Property BackupDirectory is Not Available for Settings” and provide insights into the solution.

When I clicked on the database and attempted to initiate the restore process, I was greeted with the following error message:

Event ID: 7011
Property BackupDirectory is not available for Settings ‘Microsoft.SqlServer.Management.Smo.Settings’. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)

Initially, I was unsure about the source of the BackupDirectory property. To investigate further, I decided to capture a profiler trace while clicking on the restore option. Upon analyzing the trace, I discovered the following code snippet:

declare @BackupDirectory nvarchar(512)
if 1=isnull(cast(SERVERPROPERTY('IsLocalDB') as bit), 0)
select @BackupDirectory=cast(SERVERPROPERTY('instancedefaultdatapath') as nvarchar(512))
else
exec master.dbo.xp_instance_regread @HkeyLocal, @InstanceRegPath, N'BackupDirectory', @BackupDirectory OUTPUT

This code snippet revealed that SQL Server was looking for a registry key specific to my SQL instance. It suddenly dawned on me that I had been experimenting with a registry setting for one of my previous blog posts, which likely caused this issue.

The solution to this problem was relatively straightforward. I discovered that the “BackupDirectory” setting was empty. Once I entered a valid value in the highlighted text box for “backup” and clicked OK, I was able to proceed with the restore process without encountering any errors.

It’s worth mentioning that the default setting for backup can be quite useful. By specifying a default backup directory, you can streamline the restore process and avoid potential errors like the one I encountered. It’s always a good practice to ensure that the necessary settings are properly configured to prevent any unexpected issues.

Have you ever utilized the default setting for backup in SQL Server? Understanding its purpose and functionality can greatly enhance your experience with database backups and restores.

Thank you for reading this blog post. I hope you found it helpful in resolving the “Property BackupDirectory is Not Available for Settings” error in SQL Server. Stay tuned for more SQL Server tips and tricks!

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.