2

I am trying to make a command line argument that will backup all my websites to a file which I can then move periodically to offsite backup location. I would need all the content and all the settings so in case of a server fault I can easily restore the setup again quickly.

I found this command msdeploy -verb:sync -source:appHostConfig='DefaultWebsite',computerName=server1 -dest:package='defaultWebsiteBackup.zip' -enableLink:AppPoolExtension

This looks nice and all, but I would need to make a command for each website. Is there a way to backup all sites (and future sites) in the same command?

Anders
  • 143
  • 1
  • 6

1 Answers1

3
msdeploy -verb:sync -source:webServer,computerName=server1 -dest:package='defaultWebsiteBackup.zip',encryptPassword=password123 

The -source:webServer does a complete backup of everything. App pools and other config values, including SSL certs (if you have any). The encryptPassword is required if you have SSL certs.

Bart De Vos
  • 17,761
  • 6
  • 62
  • 81