Before running the Web Deploy commands to update a web site, make sure to create a backup of the target web files in case a rollback of the operation is required. The process to make a backup on the target server is quick and I would recommend adding these steps to any scripts used for deployments on an IIS server.
These scripts are run from the source server (10.0.0.11) and backing up the files on the target server (10.0.0.12) and the packages are stored on the target server in the c:\_WebDeploy folder.
Web Site Settings Backup:
The first example uses the AppCmd utility to backup the IIS settings. If a server level or web site level deployment has modifications to the IIS settings, make a backup copy of the target IIS settings to quickly restore the server if there are issues with the deployment. Again, this is for IIS settings only.
%windir%\system32\inetsrv\appcmd add backup “PreContoso_v2.1_Deployment”
Web Site Content Backup:
This command will backup all settings for the target IIS server.
Server Level Backup:
msdeploy –verb dump –source:webServer,computername=10.0.0.12 dest package=c:\_WebDeploy\Contoso_v2.1_Deployment.zip
Web Site Level Backup:
msdeploy –verb:dump -source:contentPath="Contoso.com",computername=10.0.0.12 -dest:package=c:\_WebDeploy\Contoso_v2.1_Deployment.zip
The contentPath provider uses the dirPath and filePath providers to function.
Folder Level Backup:
msdeploy –verb:dump –source:dirPath=="c:\inetput\websites\contoso\staticfiles",computername=10.0.0.12 -dest:package=c:\_WebDeploy\Contoso_v2.1_staticfiles.zip