none
IIS 8.5 - What's Best Way to Move INETPUB directory to Another Drive? RRS feed

  • Question

  • Does anyone have step by step process moving IIS 8.5 INETPUB directory to Another Drive? Running Windows Server 2012 R2.

    Thanks.

    Monday, June 2, 2014 6:21 PM

Answers

  • Moving that folder is very straight forward. Unlike some folders relating to windows services, the standard inetpub folder is simply the default location that sites run from, it doesn't define where new sites go when you set them up.

    So, simply create your new inetpub folder on the required drive, and give it the same permissions as the standard one as a baseline. When you setup new sites you're asked to enter the path that the site will be found, at which point you simply point to the site to the relevant folder on your chosen drive.

    If you already have sites configured in IIS, simply copy the data over to the new destination, configure the permissions to the same as the source folder, and then in IIS select each site on by one, on the right hand pane click on Basic Settings... and then edit the Physical path to where the new folder is. Once you've done that the site will be using the new folder. You can then removed the old folder, though personally I'd wait until you've had chance to fully test it and ensure everything is working as it should be (eg you haven't missed any permissions).

    Monday, June 2, 2014 6:31 PM
  • Oh one other thing to consider if you're trying to ensure you don't have too much content on the system drive, is to move the IIS website log folder. By default it lives in c:\windows\system32\logfiles\ so you might want to move that to a folder on another drive since on a busy server that can get quite big.

    Within each site you can configure this by going into Logging within the site, and then setting the new destination folder. To configure the default for all new websites, go into IIS and select the server name at the top. You'll see the Logging option in the middle, and editing that will set the default for all the websites (I don't think it edits existing sites, but I could be wrong. I always do it as part of the initial setup, so it's never come up!).

    Monday, June 2, 2014 6:39 PM

All replies

  • Moving that folder is very straight forward. Unlike some folders relating to windows services, the standard inetpub folder is simply the default location that sites run from, it doesn't define where new sites go when you set them up.

    So, simply create your new inetpub folder on the required drive, and give it the same permissions as the standard one as a baseline. When you setup new sites you're asked to enter the path that the site will be found, at which point you simply point to the site to the relevant folder on your chosen drive.

    If you already have sites configured in IIS, simply copy the data over to the new destination, configure the permissions to the same as the source folder, and then in IIS select each site on by one, on the right hand pane click on Basic Settings... and then edit the Physical path to where the new folder is. Once you've done that the site will be using the new folder. You can then removed the old folder, though personally I'd wait until you've had chance to fully test it and ensure everything is working as it should be (eg you haven't missed any permissions).

    Monday, June 2, 2014 6:31 PM
  • Oh one other thing to consider if you're trying to ensure you don't have too much content on the system drive, is to move the IIS website log folder. By default it lives in c:\windows\system32\logfiles\ so you might want to move that to a folder on another drive since on a busy server that can get quite big.

    Within each site you can configure this by going into Logging within the site, and then setting the new destination folder. To configure the default for all new websites, go into IIS and select the server name at the top. You'll see the Logging option in the middle, and editing that will set the default for all the websites (I don't think it edits existing sites, but I could be wrong. I always do it as part of the initial setup, so it's never come up!).

    Monday, June 2, 2014 6:39 PM
  • Hello,

    Any update? Is the suggestion work for you.

    Since this is a IIS related issue, you can also ask  in  IIS forum.

    http://forums.iis.net/

    Thank you.

    Thursday, June 5, 2014 1:38 AM
    Moderator
  • Does anyone have step by step process moving IIS 8.5 INETPUB directory to Another Drive? Running Windows Server 2012 R2.

    Thanks.

    My Method: Stop www services, stop "WAS" service, and other services which may use inetpub. Take owner of c:\inetpub and correct the rights so you can move it, usually some files in sub folders are owned by "TrustedInstaller" and you cannot move it.

    Then MOVE the directory to i.e. D:

    Get Hardlink Shell Extension from http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html

    Create a JUNCTION from the new inetpub directory to C:\inetpub, by drag-and-drop the inetpub directory to C: drive with the right mouse button, and choose "junction".

    You can create the same Junction with mklink, but Hardlink Shell Extension is nicer.

    Result: For the system inetpub is still on C:, but in reality it is on D: or wherever you moved it.





    • Edited by Setsunaaa Wednesday, September 7, 2016 10:15 AM
    Wednesday, September 7, 2016 9:33 AM
  • This works:

    https://gallery.technet.microsoft.com/scriptcenter/Script-to-move-the-IIS-f1fb62a5

    Tuesday, March 13, 2018 5:30 PM
  • Has anyone tested this script on Windows Server 2016?  I've used it successfully on earlier platforms, however, not tried on Windows 2016 yet. 

    Thank you!
    Carmen

    Wednesday, February 27, 2019 1:41 PM
  • Has anyone tested this script on Windows Server 2016?  I've used it successfully on earlier platforms, however, not tried on Windows 2016 yet. 

    Thank you!
    Carmen

    Haven't tested it on Windows Server 2016, yet...but I just used it succesfully on a Windows Server 2019 machine, so I guess Server 2016 should be fine, as well!
    Friday, August 2, 2019 9:45 AM
  • Works on Windows Server 2016.

    Just make sure to download file instead of copying code from the page (due to extra CRLFs).

    Friday, October 25, 2019 1:16 AM