We would like to move the App_Data folder outside our Sitefinity project (say to “C:\App_Data”). How could we accomplish this?
The rationale for this requirement is the that we currently use a versioning scheme for our binaries that follows this convention: “\\fileserver\MySite\<version>” for example “\\fileserver\MySite\1.0”, “\\fileserver\MySite\1.1”, and so on.
Each <version> folder is a complete copy of our Sitefinity project. The AppPool identity user has read permissions on the “\\fileserver\MySite” directory (that inherits on to the <version> subdirectory).
Since we need the write permissions on the App_Data folder only, we would like to avoid setting those permissions on the folder manually after each deployment (and setting them on the project folder is not acceptable).
Anyone have this scenario? can tell us if is configurable?
i have found the following thread: http://www.sitefinity.com/devnet/forums/sitefinity-4-x/sdk/sdk-and-app-data.aspx that says that is possible to have files outside but does not says how, and if is possible to move the whole folder.
Thanks in advance for your help
You can set App_Data as virtual directory in IIS for every version site pointing to the same physical folder.
1. Copy the “App_Data” folder from one of the web sites to the “C:\App_Data”
2. Set the appropriate permissions for the folder
3. Delete “App_Data” folder in all version sites
4. Open IIS Manger and do the rest of the steps for all version sites
5. Select the web site in the tree view on the left side
6. Right click and choose “Add Virtual Directory”
7. In the popup window in the field “Alias” write “App_Data”
8. In the “Physical Path” field select “C:\App_Data”
9. Click “OK”
The proposed solution is working fine for a number of clients of ours. From the reference post it looks like the permissions for the shared folder are not set correctly.
I'm encountering problems trying to relocate the App_Data folder as well. When I follow Bob's instructions I get the error below.
[UnauthorizedAccessException: Access to the path 'C:\inetpub\dev-sitefinity-education.company.com\App_Data\Sitefinity\Temp\Libraries' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +12892935
System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj) +1594
System.IO.Directory.CreateDirectory(String path) +311
[TypeInitializationException: The type initializer for 'Telerik.Sitefinity.Modules.Libraries.LibrariesManager' threw an exception.]
Telerik.Sitefinity.Web.UI.PublicControls.ImageControl.InitializeControls(GenericContainer container) +346
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4185
Why is Sitefinity trying to access the non-existent 'C:\inetpub\dev-sitefinity-education.company.com\App_Data\Sitefinity\Temp\Libraries' folder rather than the actual 'C:\App_Data\Sitefinity\Temp\Libraries' folder? Is the problem with how it is mapping the virtual directory to the physical directory?
Per Bob's instructions, I set the permissions on the copied App_Data folder. I ran another test to try to rule out a permissions issue. I renamed the original, working App_Data folder to App_Data_Original (no change to working permissions) and created an App_Data virtual directory referencing the App_Data_Original folder. When I tried to open the website I got the same error above.