locked
moving inetpub - amazingly not mentioned in this forum RRS feed

  • Question

  • The planning document says, "

    ·       Make sure that the Internet Information Services (IIS) Web root is installed on a non-system NTFS partition for file system-level security. A non-system partition is other than the partition that contains the operating system files. (For example, C:\Inetpub is on a typical system partition, whereas D:\Inetpub is not.)"

     

    Yet there doesn't appear to be a way to direct the location of installation on the 2008 server.  Is there any preferred method of moving it?

     

    How can I be the first person to have asked this question?

    Thursday, April 15, 2010 2:03 PM

Answers

  • Here's a solution from http://blogs.iis.net/thomad/archive/2008/02/10/moving-the-iis7-inetpub-directory-to-a-different-drive.aspx

    The author comments that the original directory structure must remain to service unlikely access by an upgrade or hotfix.  However, there are registry entries made that claim to satisfy that problem.  Can anyone here confirm the completeness of this process?

    REM PLEASE BE AWARE: SERVICING (I.E. HOTFIXES AND SERVICE PACKS) WILL STILL REPLACE FILES REM IN THE ORIGINAL DIRECTORIES. THE LIKELIHOOD THAT FILES IN THE INETPUB DIRECTORIES HAVE REM TO BE REPLACED BY SERVICING IS LOW BUT FOR THIS REASON DELETING THE ORIGINAL DIRECTORIESREM IS NOT POSSIBLE. @echo offIF "%1" == "" goto errsetlocalset MOVETO=%1:\REM simple error handling if drive does not exist or argument is wrong IF NOT EXIST %MOVETO% goto errREM Backup IIS config before we start changing config to point to the new path%windir%\system32\inetsrv\appcmd add backup beforeRootMoveREM Stop all IIS servicesiisreset /stopREM Copy all content REM /O - copy ACLsREM /E - copy sub directories including empty onesREM /I - assume destination is a directoryREM /Q - quietREM echo on, because user will be prompted if content already exists.echo onxcopy %systemdrive%\inetpub %MOVETO%inetpub /O /E /I /Q@echo offREM Move AppPool isolation directory reg add HKLM\System\CurrentControlSet\Services\WAS\Parameters /v ConfigIsolationPath /t REG_SZ /d %MOVETO%inetpub\temp\appPools /fREM Move logfile directories%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.traceFailedRequestsLogging.directory:"%MOVETO%inetpub\logs\FailedReqLogFiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"%MOVETO%inetpub\logs\logfiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"%MOVETO%inetpub\logs\logfiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"%MOVETO%inetpub\logs\logfiles"REM Move config history location, temporary files, the path for the Default Web Site and the custom error locations%windir%\system32\inetsrv\appcmd set config -section:system.applicationhost/configHistory -path:%MOVETO%inetpub\history%windir%\system32\inetsrv\appcmd set config -section:system.webServer/asp -cache.disktemplateCacheDirectory:"%MOVETO%inetpub\temp\ASP Compiled Templates"%windir%\system32\inetsrv\appcmd set config -section:system.webServer/httpCompression -directory:"%MOVETO%inetpub\temp\IIS Temporary Compressed Files"%windir%\system32\inetsrv\appcmd set vdir "Default Web Site/" -physicalPath:%MOVETO%inetpub\wwwroot%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='401'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='403'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='404'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='405'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='406'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='412'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='500'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='501'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='502'].prefixLanguageFilePath:%MOVETO%inetpub\custerrREM Make sure Service Pack and Hotfix Installers know where the IIS root directories arereg add HKLM\Software\Microsoft\inetstp /v PathWWWRoot /t REG_SZ /d %mOVETO%\inetpub\wwwroot /f reg add HKLM\Software\Microsoft\inetstp /v PathFTPRoot /t REG_SZ /d %MOVETO%\inetpub\ftproot /fREM Do the same for x64 directoriesif not "%ProgramFiles(x86)%" == "" reg add HKLM\Software\Wow6432Node\Microsoft\inetstp /v PathWWWRoot /t REG_EXPAND_SZ /d %MOVETO%inetpub\wwwroot /f if not "%ProgramFiles(x86)%" == "" reg add HKLM\Software\Wow6432Node\Microsoft\inetstp /v PathFTPRoot /t REG_EXPAND_SZ /d %MOVETO%inetpub\ftproot /fREM Restart all IIS servicesiisreset /startecho.echo.echo ===============================================================================echo Moved IIS7 root directory from %systemdrive%\ to %MOVETO%.echo.echo Please verify if the move worked. If so you can delete the %systemdrive%\inetpub directory.echo If something went wrong you can restore the old settings via echo   "APPCMD restore backup beforeRootMove" echo and echo   "REG delete HKLM\System\CurrentControlSet\Services\WAS\Parameters\ConfigIsolationPath"echo You also have to reset the PathWWWRoot and PathFTPRoot registry valuesecho in HKEY_LOCAL_MACHINE\Software\Microsoft\InetStp.echo ===============================================================================echo.echo.endlocalgoto successREM error message if no argument or drive does not exist:errecho. echo New root drive letter required. echo Here an example how to move the IIS root to the F:\ drive:echo. echo MOVEIISROOT.BAT Fecho.echo. :success

     

    • Marked as answer by mardukes Tuesday, April 27, 2010 6:53 PM
    Thursday, April 15, 2010 4:53 PM

All replies

  • Here's a solution from http://blogs.iis.net/thomad/archive/2008/02/10/moving-the-iis7-inetpub-directory-to-a-different-drive.aspx

    The author comments that the original directory structure must remain to service unlikely access by an upgrade or hotfix.  However, there are registry entries made that claim to satisfy that problem.  Can anyone here confirm the completeness of this process?

    REM PLEASE BE AWARE: SERVICING (I.E. HOTFIXES AND SERVICE PACKS) WILL STILL REPLACE FILES REM IN THE ORIGINAL DIRECTORIES. THE LIKELIHOOD THAT FILES IN THE INETPUB DIRECTORIES HAVE REM TO BE REPLACED BY SERVICING IS LOW BUT FOR THIS REASON DELETING THE ORIGINAL DIRECTORIESREM IS NOT POSSIBLE. @echo offIF "%1" == "" goto errsetlocalset MOVETO=%1:\REM simple error handling if drive does not exist or argument is wrong IF NOT EXIST %MOVETO% goto errREM Backup IIS config before we start changing config to point to the new path%windir%\system32\inetsrv\appcmd add backup beforeRootMoveREM Stop all IIS servicesiisreset /stopREM Copy all content REM /O - copy ACLsREM /E - copy sub directories including empty onesREM /I - assume destination is a directoryREM /Q - quietREM echo on, because user will be prompted if content already exists.echo onxcopy %systemdrive%\inetpub %MOVETO%inetpub /O /E /I /Q@echo offREM Move AppPool isolation directory reg add HKLM\System\CurrentControlSet\Services\WAS\Parameters /v ConfigIsolationPath /t REG_SZ /d %MOVETO%inetpub\temp\appPools /fREM Move logfile directories%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.traceFailedRequestsLogging.directory:"%MOVETO%inetpub\logs\FailedReqLogFiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"%MOVETO%inetpub\logs\logfiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"%MOVETO%inetpub\logs\logfiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"%MOVETO%inetpub\logs\logfiles"REM Move config history location, temporary files, the path for the Default Web Site and the custom error locations%windir%\system32\inetsrv\appcmd set config -section:system.applicationhost/configHistory -path:%MOVETO%inetpub\history%windir%\system32\inetsrv\appcmd set config -section:system.webServer/asp -cache.disktemplateCacheDirectory:"%MOVETO%inetpub\temp\ASP Compiled Templates"%windir%\system32\inetsrv\appcmd set config -section:system.webServer/httpCompression -directory:"%MOVETO%inetpub\temp\IIS Temporary Compressed Files"%windir%\system32\inetsrv\appcmd set vdir "Default Web Site/" -physicalPath:%MOVETO%inetpub\wwwroot%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='401'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='403'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='404'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='405'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='406'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='412'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='500'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='501'].prefixLanguageFilePath:%MOVETO%inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='502'].prefixLanguageFilePath:%MOVETO%inetpub\custerrREM Make sure Service Pack and Hotfix Installers know where the IIS root directories arereg add HKLM\Software\Microsoft\inetstp /v PathWWWRoot /t REG_SZ /d %mOVETO%\inetpub\wwwroot /f reg add HKLM\Software\Microsoft\inetstp /v PathFTPRoot /t REG_SZ /d %MOVETO%\inetpub\ftproot /fREM Do the same for x64 directoriesif not "%ProgramFiles(x86)%" == "" reg add HKLM\Software\Wow6432Node\Microsoft\inetstp /v PathWWWRoot /t REG_EXPAND_SZ /d %MOVETO%inetpub\wwwroot /f if not "%ProgramFiles(x86)%" == "" reg add HKLM\Software\Wow6432Node\Microsoft\inetstp /v PathFTPRoot /t REG_EXPAND_SZ /d %MOVETO%inetpub\ftproot /fREM Restart all IIS servicesiisreset /startecho.echo.echo ===============================================================================echo Moved IIS7 root directory from %systemdrive%\ to %MOVETO%.echo.echo Please verify if the move worked. If so you can delete the %systemdrive%\inetpub directory.echo If something went wrong you can restore the old settings via echo   "APPCMD restore backup beforeRootMove" echo and echo   "REG delete HKLM\System\CurrentControlSet\Services\WAS\Parameters\ConfigIsolationPath"echo You also have to reset the PathWWWRoot and PathFTPRoot registry valuesecho in HKEY_LOCAL_MACHINE\Software\Microsoft\InetStp.echo ===============================================================================echo.echo.endlocalgoto successREM error message if no argument or drive does not exist:errecho. echo New root drive letter required. echo Here an example how to move the IIS root to the F:\ drive:echo. echo MOVEIISROOT.BAT Fecho.echo. :success

     

    • Marked as answer by mardukes Tuesday, April 27, 2010 6:53 PM
    Thursday, April 15, 2010 4:53 PM
  • Sorry that the code editor lost the line breaks.  I tried.  I hope it's not too hard to figure out the batch file.
    Thursday, April 15, 2010 4:57 PM
  • but i think you don't need to move intpub folder
    Thanks for any help :) my blog is: http://www.waelk.com
    Thursday, April 22, 2010 6:49 AM
  • but i think you don't need to move intpub folder
    Thanks for any help :) my blog is: http://www.waelk.com

    As much as I would like to agree with you, I did post the instruction from the Microsoft documentation above.  It is their product.
    Friday, April 23, 2010 4:00 PM
  • ok but i befour i want to move my test server to live prodacution with a new domain and AD all i was do is backup my organization database and if " that if i have a custom asp pages inside ISV folder under intpub i copy this pages" , and i make a new installation for crm and restour the database and import the organization and copy the custom asp pages to my "intpub/ISV/" that is all.
    Thanks for any help :) my blog is: http://www.waelk.com
    Sunday, April 25, 2010 5:47 AM
  • thank you

    Again, as much as I would like to agree with you, I did post the instruction from the Microsoft documentation above.  It is their product.

    Tuesday, April 27, 2010 6:54 PM