Setting up automatic backups in Web Deploy tool
Asked Answered
A

2

12

I've been struggling to setup automatic backup, but seems to have hit a wall. Following this document, and using Powershell, I've enabled the backups (TurnOn-Backups -On $true, then Configure-Backups -SiteName "test1" -Enabled $true; so Get-BackupSettings -SiteName "test1" tells me the backup is enabled).

However, whenever I do a publish from Visual Studio - no backup is created. I've set the backup path, the permissions are set to allow everything for everyone.. so I have no idea what else I can check.

Anglophile answered 14/9, 2012 at 17:37 Comment(1)
I'm actually working on this same issue. I'll let you know when I figure it out. :)Vharat
V
11

Short Answer: Currently broken in VS 2010 "Web One Click Publish" feature. :'(

I spent nearly an entire week working closely with the MS Dev team and trying everything imaginable on this one and have yet to find a solution that doesn't involve the msdeploy.exe command utility (i.e. no luck for doing this from VS directly using the "Web One Click Publish" feature). :(

Hopefully they make a patch to address this issue in VS 2010 SP1. Web Deploy is supported (See "Features" section) but the Automatic Backup feature is not. I know this isn't the answer you were looking for, nor was I, but the sad fact of the matter nevertheless.

I think the best you can hope for at this point is as Sayed answered here, and while old, remains the only solution at this time (Note: The msbuild tab for the old VS 2008 Web Site template is now "Build Events" under the Compile tab in VS 2010 Web App projects). Only downside to this method is that it will create a backup every time you compile, not just when you deploy. Otherwise you'll have to write a special script that you run prior to each publish.

On a side note, you can also edit your web deploy configuration via IIS Manager at the server level using the "Configuration Editor" (must have the Management role installed).

enter image description here

Vharat answered 19/10, 2012 at 17:38 Comment(3)
@Eugene Indeed. Makes me sad face. :(Vharat
You guys rock: the turnedOn item has been missing from my configuration! This is in my opinion the most misleading part about the automatic backups. I have added that item to my server configuration and voila the backups are being created. On the side note: I have followed those same Microsoft instructions but got nowhere with the PowerShell commands, so I have used their Manual Configuration instructions instead. The instructions say nothing about the turnedOn element - what a grave omission.Palmirapalmistry
I've managed to get one-click publishing with VS2010 to successfully create backups. Please see my answer below and let me know if it works for you?Rodriguez
R
2

I managed to get VS2010 to deploy automatic backups, by stealing some ideas from this question: msdeploy (Web Deploy) failing with 401 auth issues

First install Web Deploy v3.5 on your local computer - the one with VS2010 installed on it.

Now edit your VS2010 environment config:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config
# or
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config

Find the <assemblyBinding> node, and add the following just inside it:

<dependentAssembly>
    <assemblyIdentity 
        name="Microsoft.Web.Deployment" 
        publicKeyToken="31bf3856ad364e35" culture="neutral"/>
    <bindingRedirect oldVersion="7.1.0.0" newVersion="9.0.0.0"/>
</dependentAssembly>

Save, and restart VS2010.

You should now find you can use one click publishing in VS2010 to push to a server running Web Deploy v3, and if you've configured backups correctly on the server (see @Chiramisu's answer) then backups should be successfully created! Woop!

Rodriguez answered 10/10, 2013 at 13:22 Comment(2)
Hi @Robin, where would one find those values for publicKeyToken and bindingRedirect values? Some context on those please?Parian
Hi @Divan. I'm afraid this was 10 years ago and I haven't used VisualStudio for 9 years at this point. I have absolutely no idea.Rodriguez

© 2022 - 2024 — McMap. All rights reserved.