9

I have managed to setup Web Deploy Automatic Backups by following this guide, which works great. However, in my websites I have a folder relative to the root /uploads/ which contains all user-uploaded images which can be quite large.

The backup snapshot took a copy of that folder as well, and this results in huge backups. Is it possible to exclude certain folders from the backup?

bowserm
  • 1,046
  • 10
  • 25
Karl Cassar
  • 6,043
  • 10
  • 47
  • 84
  • I have the same problem, for me however it's the app_data folder, and this pushes the backup above 4GB. Annoyingly, once it's above 4GB, it refuses to back it up anymore. – Jordan Robinson Sep 15 '15 at 23:10
  • Why do you need to take backup of deployed app if you don't want to backup users' uploaded data? I mean, backups should be of database and uploaded files. – Sahil Bhardwaj Sep 22 '15 at 20:59

1 Answers1

3

There are skip parameters that you can use, try:

msdeploy.exe -verb:sync -source:backupmanager -dest:backupmanager=<siteName>,uselast=true -skip:xpath=dirPath[@path='App_Data']

So basically add -skip:xpath="/uploads/"

Niki van Stein
  • 10,564
  • 3
  • 29
  • 62
  • I had to modify it slightly to be used in a publish profile, but your input combined with the example at https://github.com/entaconsulting/devs201508/blob/36f6ffab10fc6cf61c2100b401942ee6ea7a4642/WebApplication1/MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0/tools/VSToolsPath/Web/Microsoft.DNX.Publishing.targets worked perfectly. – Jordan Robinson Sep 23 '15 at 12:11
  • Great :) feel free to accept it as answer or put your final working fix as answer. – Niki van Stein Sep 23 '15 at 12:55
  • Sadly I only added the bounty to this question and didn't create it myself, otherwise I definitely would. – Jordan Robinson Sep 23 '15 at 20:10
  • Aaah I see, well no problem anyways! – Niki van Stein Sep 23 '15 at 20:16
  • @JordanRobinson How did you do it in a publish profile (pubxml file)? I don't know what the parameter is for the XML file. We have a directory of user-uploaded content that's over 30GB and I'd rather not back that up when publishing from VS. – vaindil Oct 01 '15 at 16:54
  • @Vaindil The concept is pretty much the same, the syntax is just a bit different of course. Here's a gist: https://gist.github.com/JordanRobinson/40d6a6783221077a710b – Jordan Robinson Oct 04 '15 at 00:30