Maintaining App_Data directory across deployments


We have a couple of small websites which are using a cms system which stores userdata in the website’s app_data folder. Is it possible to persist the data in this directory across releases?

I was thinking I might have to do it with one of the powershell scripts (probably postDeploy?), but not entirely sure on the best way to query for “previous deployment path” in the script.


Hi Andy,

Thanks for getting in touch! The custom installation directory should work for you in this instance:

You can tell it what directory to install to, and make it not purge the directory first.

Hope this helps!

Hi Vanessa - that will do nicely, I have combined it with a few replacement variables to keep the path as close to octopus default as I can:



This is however not ideal for .NET projects. In the case of MVC view for example, moving a view to a shared folder will cause the not-purging option to have the view in 2 places.
Is there any way to exclude some files from the purging process, without replaceing the whole step with a powershell script?

Hi Michiel,

The concept behind these features has not really changed. We have step templates in the Library that let you define files to delete if you know the file path. So perhaps this is an option for you?!/step-template/actiontemplate-file-system-clean-directory