Link to home
Create AccountLog in
Avatar of sharad_rai

asked on

Cloning IIS 7.5 website from one server to another

We have an app running on IIS 7.5 that we would like to move to another IIS 7.5 server. I would like to first export/import the site from old to new server and test it before the final cut over.

I found something about web deploy tool that I can use. What would be the best way to use this tool to make a duplicate site from old to new server for testing?

Avatar of bepsoccer1
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of sharad_rai


Thanks bepsoccer1,
Steps look fairly simple! This will however not break anything on the production site right? We want that site to be fully functional while we test the site on the new server.

msdeploy.exe -verb:sync -source:apphostconfig="Default Web Site" -dest:package=c:\ > DWSpackage7.log

oops, one more question. So I will change the "Default Web Site" to the name of the site I want to copy, correct? Please also note, I have multiple sites running on the same old server with host headers and I want the site also function in the same way on the new server.

No, it should not stop IIS or impact it when you run it.  And yes, replace "Default Site" with the name of your site.
I will give it a try now... Thanks,
Will the switch "...-verb: sync" attempt to keep these sites in sync when online? Any change on one site will change the other site as well?
I'm sorry for my naiveness but it's been a while that I have worked with IIS.

thanks, Sharad
No it will not continue to try to sync that is something completely different which is know as web farm framework.
That seems like a great tool, but FWIW, I've always used the GUI for robocopy and it's worked perfectly (including permissions on NTFS folders, which is usually a pain even if you get the site copied because permissions may not be).  That does require resetting up in IIS though for HTTP/HTTP/FTP.  Are you also just doing a restore of the DB for the site (if applicable)?
Hi ajmehta,
I did run that tool (msdeploy) and the site seems to have replicated over nicely. I am trying to set it for some testing with the dev team here before I can confirm its working.
And I didn't understand the DB question, do sites have databases too?

If it's a web application, oftentimes you have user accounts or other data that you may have in SQL or other database.  it's possible that you used a local Access DB or something else, but you'll need to check.
This site in fact runs an app/api that connects to one of our SQL clusters. I think Devs will provision about how to test this piece on the server.
In that case, be careful testing, because your TEST site is connecting to LIVE data/api's
Your connection strings should be in the root web.config.  You will need to change them to point to different databases should you not want to test with live data.
I have let the devs know about it - thanks,
I eventually exported and imported the site from production to a test server couple of days ago to run in parallel with the production site using web deploy tool. Incidentally, the production site is down and has been down without any one noticing it and my question is: "does the tool break the source site during backup/restore process?

the test site is up however...
it shouldn't... but you could restart the app pool and website in IIS
This solution alone was enough for me to accomplish what I wanted to achieve. Other suggestions were good but not directly applicable to this issue.