views:

126

answers:

2

I am researching one-click deployment with Visual Studio 2010, the current deployment process involves zipping up the contents of the IIS folder and taking a backup of the current database before completing the remaining manual deployment steps. This allows us to roll back a deployment, I need to retain the essence of this process if not the specifics.

Is there a way of automating this with MSDeploy?

+1  A: 

You can have MSDeploy execute a batch file that backs up the IIS directory (see example)

You can also write some SQL, put it in a .sql file, execute the SQL script in the batch file as well. See this example to at least get a start. It is for SQL server, but if you are not using that then hopefully the database you are using has something similar.

kniemczak
I understand how to backup IIS, SQL Server and the files from the command line, thanks. I haven't found a way to execute an arbatary command on the server with MSDeploy.
Richard Slater
What I was trying to state above is that you could write those commands, store them in a batch file, and then execute them as part of the deployment process. In one of our projects we copy files to numerous locations on deployment by executing a batch file.
kniemczak
Your links don't actually describe the MSDeploy deployment process, just how to write scripts to backup IIS and SQL.
Richard Slater
A: 

Finally I found the answer, thank you to kniemczak for posting the information about how to backup IIS and SQL Server from the command line.

It seems the following:

msdeploy.exe
     -verb:sync -source:runCommand='C:\Scripts\Backup.cmd' 
     -dest:auto,computername=192.168.0.1

Should cover my needs.

Richard Slater