0

I have a Windows 2008 R2 Server and I'm looking for the easiest method to backup the Bindings for the server. I have a whole ton of bindings for one particular IIS "website" and need to find a way to back those up and be able to restore them in case of server crash or migrating to another server.

How can this be done?

I can grab a list from the Advanced Properties, but its read only, so I'd have to reset them up one at a time.

Any ideas? It doesn't have to be a daily systematic backup process, but I'd feel more comfortable knowing that I could get those in a new server quickly.

I've seen references to the APPCMD, but haven't yet seen how that can export that complete list of bindings nor import.

Sorry, not experienced in this. Thanks!

kirkhilles
  • 31
  • 4
  • Its not ideal, but I've found to way to do it using PHP to create a windows Batch file. I grab the Bindings from the "Advanced Settings" from the Manage Website function and parse that and create a whole bunch of appcmd set sites to re-create it. – kirkhilles Sep 27 '15 at 01:19

2 Answers2

4

using command prompt with below command we can do it,

Export / Backup:

%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml

Restore:

%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml
Ramanan
  • 61
  • 2
  • 7
1

Web Deploy (aka msdeploy.exe) is probably the simplest way to do that, in fact when you install it you will get a UI extension inside IIS manager that will let you do that (backup/export) easily in the UI.

here is also an example on how to use the command line to export a site and its settings into a package (zip file): http://www.iis.net/learn/publish/using-web-deploy/packaging-and-restoring-a-web-site

I would also say that you could also just copy the <site> snippet for teh web site that includes its bindings inside c:\windows\system32\inetsrv\config\applicationHost.config, since IIS uses XML settings that would be pretty simple. One word of caution though, if you use SSL bindings those do need a bit more setup since they also need to be registered with HTTP.sys (netsh http ssl addcert) but if not, just editing the XML would be pretty simple (make sure to do that carefully and backup the file).

Carlos Aguilar Mares
  • 13,411
  • 2
  • 39
  • 36