I have an interesting request from my client and am trying to figure out the best way to handle it - with a script preferably.
They want me to have 2 sites on production. The first is the actual live website, the second is the last version (in case we need to roll back) and will be the target of the next upgrade. Once the upgrade is done they would like to "swap" all header info (host header, IP, SSL, etc) so we have a minimum of downtime.
I've used the following to allow multiple sites to use 443 with SSL and it works fine:
C:\Inetpub\AdminScripts>cscript.exe adsutil.vbs set /w3svc/1/SecureBindings ":443:www.test.com"
Now, I'd like to figure out how to script a swap of sites which would include dropping then re-adding the SSL mapping.
Any and ALL ideas are welcome as I don't personally think this is the best solution. :)
----- NEW --------------------------------------------------
I think I found the better way to do this.
set PROD1=502916593
set PROD2=1319193536
c:
cd C:\Inetpub\AdminScripts\
cscript.exe adsutil.vbs get W3SVC/%PROD1%/root/path
cscript.exe adsutil.vbs get W3SVC/%PROD2%/root/path
SET CONFIRM=
SET /P CONFIRM=Hit ENTER to make Prod1 active, 2 to make Prod2 active:
IF ?%CONFIRM%? EQU ?? GOTO :P1
:P2
cscript.exe adsutil.vbs set W3SVC/%PROD1%/root/path c:\mywebs\prod2
cscript.exe adsutil.vbs set W3SVC/%PROD2%/root/path c:\mywebs\prod1
GOTO :EOF
:P1
cscript.exe adsutil.vbs set W3SVC/%PROD1%/root/path c:\mywebs\prod1
cscript.exe adsutil.vbs set W3SVC/%PROD2%/root/path c:\mywebs\prod2
:EOF
cscript.exe adsutil.vbs get W3SVC/%PROD1%/root/path
cscript.exe adsutil.vbs get W3SVC/%PROD2%/root/path
Does anyone see any drawbacks to this approach?