1

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?

Dominic Brunetti
  • 989
  • 3
  • 18
  • 36

1 Answers1

1

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?

Community
  • 1
  • 1
MonkeyDreamzzz
  • 3,978
  • 1
  • 39
  • 36