automatic backup for web deploy 3 (IIS) - to exclude folders in the backup
Asked Answered
S

1

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?

Sesqui answered 15/7, 2014 at 11:22 Comment(2)
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.Subassembly
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.Archean
H
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/"

Hop answered 22/9, 2015 at 15:0 Comment(6)
I had to modify it slightly to be used in a publish profile, but your input combined with the example at github.com/entaconsulting/devs201508/blob/… worked perfectly.Subassembly
Great :) feel free to accept it as answer or put your final working fix as answer.Hop
Sadly I only added the bounty to this question and didn't create it myself, otherwise I definitely would.Subassembly
Aaah I see, well no problem anyways!Hop
@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.Dorso
@Vaindil The concept is pretty much the same, the syntax is just a bit different of course. Here's a gist: gist.github.com/JordanRobinson/40d6a6783221077a710bSubassembly

© 2022 - 2024 — McMap. All rights reserved.