What is the process to copy an entire .NET website from one server to another server? Both sites are running Windows Server 2008, IIS7, and SQL 2008?

The base site is the live site

The new site is going to be used as a development site

The server hosting the development site has other, existing sites in IIS

The servers are on different networks and have different internet domain names

Part of this is easily done, such as copying the database and restoring it. The same can be said for the copying of the directory of files the IIS site gets pointed to -- no help needed for those tasks.

After the database and files are copied over, what are the necessary steps to make the site functional on the second server?

I recall having read that the MSDeploy tool may cause unintended consequences if the target (copying to) has existing sites. I have not verified this, not wanting unintended consequences. :)
–
Chris AdragnaJan 27 '12 at 16:37

1

I've had no such problems. But import them into their own web site if possible, or test the import on a development server first. And always take a backup of the IIS config (explained in the article).
–
SireJan 29 '12 at 9:53

Well, then, if that is correct, then why not use the MSDeploy tool? Certainly, if the site is very basic, a file copy will suffice, but for more complicated setups, then MSDeploy appears to be the best way to migrate. Marking your response as the correct answer. Thanks.
–
Chris AdragnaFeb 1 '12 at 17:43

The applicationHost.config is not necessary in this case since you're going to setup a development server.

I would copy over the configuration to your dev box. The easiest way to do this is to go into IIS on your production server, click on the root server and select Shared Configuration.

Then click Export Configuration... and select a location.

Then on your new server go to the same Shared Configuration and check "Enable Shared Configuration". Choose those files you just exported. When that's complete uncheck enabled shared configuration.

That should get your site setup just like it is for production.

The next thing I would do is to edit the bindings to give it a new host name for dev. If our production site is www.mysite.com we use wwwd.mysite.com for development and wwwq.mysite.com for QA.

If you're big enough to have an IT department you probably want them to set up a DNS entry so developers can just type in wwwd.mysite.com. If you don't have DNS, you can edit your hosts file with a direct mapping to wwwd.mysite.com.

When you use shared configuration you hook iis on a new ApplicationHost.config, it's the same thing. I use shared configuration in production for a webfarm. I have multiple server hook the same applicationconfig on a san. When i add a website in one of my webfarm, all other server get the website. Shared configuration will not be the best way to make an developpement environnement i think
–
Cédric BoivinDec 16 '11 at 14:22