Copy files from last successful deployment

I’m deploying an Umbraco website with Octopus Deploy however one of the plugins uses the app_data folder to store state. As the release procedure is currently configured a new directory will be created for each deployment, so this data left behind. Is there a way to copy certain files from the last successful deployment into the new deployment?

I have seen this question as well but it seems to imply there is no way to do this, is that correct?

Hey Daniel!


Will give you the path that the step was deployed to on that machine previously. You could then copy the data folders under that. Alternatively, you might want to consider using the custom installation directory option. I don’t know much about Umbraco, but typically with web application deployments it’s nice if the user data (databases, file uploads, etc.) between them is kept isolated from the application binaries, and the application is configured to use a static location rather than always being a relative path.

Hope this helps!


Hi Paul,

Thanks for your help! I ended up using a virtual directory for these app_data files. That way I can keep the new directories for each deployment and keep a single version of these files, this is also the approach I’ve taken with uploaded media. I didn’t realize this would work for app_data as I’ve had plugins in the past not use Server.MapPath("~"), which meant the files still got left behind.