Unable to open the MSSQL install folders - Transfer Ownership Issue

Today, While trying to simulate an SRDF copy scenario to one of my customer. I was trying to copy the system and the user database files to another machine.

I was trying to copy all the files from the location "C:\Program files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data" it is a SQL 2008 R2 standalone instance on a Windows 2008 R2 machine.

I was getting an "Access is Denied" message. and it was not letting me to go inside the MSSQL folder.

Initially, I was wondering whether my account didnt have enough access,

1) so checked to make sure that it was under the Administrators group and it was there.

2) Then I used runas command to Run as an Administrator but was still not able to open the MSSQL folder.

3) SQL Server was up and running and it was able to see all the databases. So, I tried to run as the SQL Service account to see the folder. But still no luck. It failed with the exact same message.

Hmmm I was wondering what's going on , why am I unable to browse the folders and how SQL is able to see those files.

After some reserach I found that the MSSQL folder was missing Owner permissions.

When I checked for the Current Owner (Folder Properties ->Security tab->click on any user or group name->Advanced ->Owner tab) . It was showing as "Unable to display the current Owner"

Then, I went ahead and clicked on the Edit button at the bottom to add a Owner to the folder.

Which had the "Change Owner to" area where I picked the right owner and finally checked the box at the bottom to "Replace Owner on Subcontainers and Objects"

Then  I was able to browse all those folders and copy the files and was able to resume my original work. 

 

It was a very small setting but gave a hard time.

Krishna Golla

https://unlockforus.blogspot.com/2007/10/unlockforme-denied-opening-folder-in.html