Change App_Data location
HI!,
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
Omar
Hi Omar,
You can set App_Data as virtual directory in IIS for every version site pointing to the same physical folder.
Instructions:
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”
Hi,
This solution doesn't work, as you explain in this post, exist references to that folder that can't be changed, like LibraryManager Temp folder.
regards,
Omar
Hello Omar,
What Bob explained is how to configure the App_Data as a vidtual directory which can be used in the context of UNC share. The post you refer, there Boyan explained that the folder cannot be changed or renamed. So the option for you is following Bob's suggestion.
All the best,
Ivan Dimitrov
the Telerik team
Hello Omar,
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.
All the best,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.Modules.Libraries.LibrariesManager.GetManager() +0
Telerik.Sitefinity.Web.UI.PublicControls.ImageControl.InitializeControls(GenericContainer container) +346
Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +82
System.Web.UI.Control.EnsureChildControls() +182
System.Web.UI.Control.PreRenderRecursiveInternal() +60
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
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.
Thanks,
Mike
Hello Mike,
Yes, unfortunately App_Data/Temp location is hard-coded relatively to the root of the web application. We logged this as a bug, it will be fixed in the first internal build after the Sitefinity 4.1 official release.
We updated your Telerik points for reporting this issue.
Kind regards,
Vlad
the Telerik team
Vlad, I already reported this issue in the temp folder in the issue tracker in march 30, this is the ticket http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=409315, because the solution of Victor was incorrect y post again here on Apr 1.
regards
Omar
Hi Omar,
Yes, you are right, this scenario with virtual directories is quite tricky, and not everyone could understand correctly how it exactly works. We are sorry for the omission.
This will be fixed in the next release.
Greetings,
Vlad
the Telerik team
While the problem does not occur when working with pages in a new Sitefinity 4.1 project, it still occurs when working with content items.
Hello Mike,
The problem is related only to uploading media content (images, videos or documents). Do let us know if it happens in a different scenario.
Greetings,
Vlad
the Telerik team
Vlad,
I get the error before I get the opportunity to try to upload anything. Simple selecting "Images", "Videos", or "Documents & Files" from the Sitefinity "Content" menu generates the error.
Thanks,
Mike
Hello Mike,
Thank you for the additional information. The fix of this issue will be included in the upcoming service pack.
Regards,
Vlad
the Telerik team