0

i'm new with windows server and IIS stuff, and i got a question the company i work for are trying to move old server with [windows server 2008 & IIS 7 & SQL server 2008~2019 & visual SVN server] to new server just bought[windows server 2019]
what we need on old IIS is the whole bunch of URL rewrite rules. How can i migrate old settigs and data properly?

I've tried the backup command appcmd add backup [name] and copy backup files to new server. On new server i've try appcmd restore backup [name]. But the new server runs an error and IIS won't start up.
Creating an instance of the COM component with CLSID FROM the IClassFactory failed due to the following error: 800700b7

The solution on MS community i found like re-install IIS and iisreset won't work. the other solution tells me to delete 2 file under \inetsrv\config\schema NetFx40_IIS_schema_update.xm & NetFx45_IIS_schema_update.xml makes IIS start but in a strange way. It did transfer the rewrite rules, but that's the only thing left i can see on IIS management tools, all the other sites and apppools settings are gone and can't add a new one or restart sites.
it loooks like this failed backup restore result photo

  • Microsoft only documented a way to migrate site by site using Web Deploy, https://learn.microsoft.com/en-us/iis/publish/using-web-deploy/synchronize-iis#part-3--synchronize-your-site-to-the-target The backup approach you tried or "The solution on MS community i found" are totally irrelevant. – Lex Li Feb 20 '23 at 07:34
  • There was a similar discussion here that may provide some help to you: https://stackoverflow.com/questions/493236/how-do-you-migrate-an-iis-7-site-to-another-server – YurongDai Feb 21 '23 at 04:50
  • Thanks!!! i'll do some research and take a try – ayaayy7643 Feb 21 '23 at 06:28

2 Answers2

0

There are two web applications under the default website of the source server IIS, the following steps can realize the migration:

Step 1: Install WEBDEPLOY on both source and target servers.

Download link: https://www.iis.net/downloads/microsoft/web-deploy

Step 2: Create the package in the source server.

Open a command prompt and run the following command to backup the IIS configuration before proceeding with the migration:

C:\>%windir%\system32\inetsrv\appcmd add backup "PreWebDeployMigration"

IIS configuration backup will be available in C:\windows\system32\inetsrv\backup folder.

Change the path to web deploy installed directory in command prompt. The default path is C:\Program Files\IIS\Microsoft Web Deploy V3 folder. Then execute the following command to get the dependencies of the website. Verify the output of dependencies and ensure that these components are properly installed on the target server:

C:\Program Files\IIS\Microsoft Web Deploy V3> msdeploy -verb:getDependencies -source:metakey=lm/w3svc/1

Execute the following command to create a compressed package file of the IIS website:

C:\Program Files\IIS\Microsoft Web Deploy V3> msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:package=c:\Site1.zip > WebDeployPackage.log

All web applications under the default website are compressed into a zip file and placed under the C:\ drive. Move the compressed package to the destination server.

Step 3: Extract the package in the target server.

Execute the following command to verify packages with server dependencies

C:\Program Files\IIS\Microsoft Web Deploy V3> msdeploy -verb:sync -source:package=c:\Site1.zip -dest:metakey=lm/w3svc/1 -whatif > WebDeploySync.log

If any dependencies are missing in the target server, the above command will display the information

Once you verified the output, run the same command without –whatif option:

C:\Program Files\IIS\Microsoft Web Deploy V3> msdeploy -verb:sync -source:package=c:\Site1.zip -dest:metakey=lm/w3svc/1 > WebDeploySync.log

Finally open the target server IIS Manager and verify that the web application is available under Default Web Site.

YurongDai
  • 1,362
  • 1
  • 2
  • 7
  • i've followed the instruction of MSdeploy, but seems nothing happened. the WebDeploySync.log under "~\web deploy V3" looks normal, just say files are added and update but the rewrite rules never appears on the new server, what did i miss? – ayaayy7643 Mar 01 '23 at 02:51
0

found a way that "might" work, haven't test yet so not quite sure
after trying to migrate IIS to new server with msdeploy tool, the rewrite map is still empty so i manually copy the segment under applicationHost.config in system32\inetsrv to new server
will it work? or i'm still an idiot wasting time?

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 07 '23 at 01:56