How to move IIS7 site from one server to another

19,728

Solution 1

Web Deployment Tool is currently the Microsoft recommended way of copying and synchronizing web applications across IIS servers.

Read more here: http://learn.iis.net/page.aspx/446/synchronize-iis/

I noticed you didn't want to use MSDeploy but you didn't mention why.

Solution 2

If your environnement is identical, i mean with the same physical path, ip etc.. you can just applicationHost.config.

The file is by default located in the C:\Windows\System32\inetsrv\config it's an xml file, si if you rigth a little tool you could change your binding before restore the file in your dev environnement

Solution 3

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.

Share:
19,728

Related videos on Youtube

Chris Adragna
Author by

Chris Adragna

Updated on September 18, 2022

Comments

  • Chris Adragna
    Chris Adragna over 1 year

    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?

  • JLeonard
    JLeonard over 12 years
    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
  • Chris Adragna
    Chris Adragna over 12 years
    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. :)
  • Sire
    Sire over 12 years
    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).
  • Chris Adragna
    Chris Adragna over 12 years
    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.