Dominic Brunetti
Dominic Brunetti

Reputation: 1069

Migrating IIS 6 to IIS 7 with Web Deploy in Powershell

I'm banging my head on this one. So want to migrate our entire IIS 6 server (dozens of sites) over to a brand new IIS 7 server using the Web Deploy tool in powershell... Here is what I've tried:

.\msdeploy -verb=sync -source=webserver=computername=$oldserver -dest=webserver=computername=$newserver

And I'm getting: Total changes: 0 (0 added, 0 deleted, 0 updated, 0 parameters changed, 0 bytes copied)

Am I missing something here?

Upvotes: 1

Views: 475

Answers (1)

MonkeyDreamzzz
MonkeyDreamzzz

Reputation: 4378

It doesn't work because you have spaces in you command. This should work

$MSDEPLOY_EXE = "${env:ProgramFiles}\IIS\Microsoft Web Deploy V3\msdeploy.exe"
&($MSDEPLOY_EXE) -verb:sync -source:webserver=computername=$oldserver -dest:webserver=computername=$newserver

I realize that the instructions are to replace a : with a = in Powershell but that is not correct in all cases. When you use the & sign you can call msdeploy as you would in the command prompt.

See here for more information How do you call msdeploy from powershell when the parameters have spaces?

Upvotes: 1

Related Questions