Are these one of the scenarios you faced in your environment?
You don't have space in default C drive and always wanted to move Inetpub to D drive.
By mistake someone configured few webservers on C drive and couple of them on D drive, in farm environment it caused issues while deploying the code base.
One of your environment is already configured in C drive long back and now you have a policy/scripts which will only work in D drive. You want to move to D drive and make this environment similar to your production/cob environment.
If you answered yes to any one of the above, then you are reading the right article. Lets follow the below steps to move Inetpub with sharepoint websites from C drive to D drive.
Step 1: Backup the current registry and Change all the registry settings as below.
Now we need to update all these references to D drive as we are moving from C drive.
Step 4: We need to run the below powershell script to update the configuration database.
#script start[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")$SPSite = new-object Microsoft.SharePoint.SPSite("http://mywebapp:24333")$WebApp = $SPSite.WebApplication#IIS zone under which webapplication is created.$IISSettings = $WebApp.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default]#Change to new path$IISSettings.Path = "D:\wss\VirtualDirectories\24333"#update and dispose$WebApp.Update()$SPSite.Dispose()#End powershell script
For example if the website you have created is in internet/intranet it would be like this
$WebApp.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::[b]Internet[/b]]$WebApp.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::[b]Intranet[/b]]For moving webapplication with Shared Service Provider(SSP) the zone will be default but the change will be in SP site object. It should be like this...[code]$SPSite = new-object Microsoft.SharePoint.SPSite("http://mywebapp:24333/ssp/admin")
So run the powershell script by make all these appropriate changes to all the sites for sharepoint.
Step 5: Run the below query to check the configuration database is updated.
select * from objects where properties like '%d:\inetpub\wwwroot\wss\v
Step 6: Start the IIS and remove/backup the C:\inetpub directory. Browse your sharepoint websites to make sure there is no issue.
This way it helps you to spend only 30 minutes to move from C drive to D drive rather than spending 1 or 2 days to completely remove all Sharepoint websites and reinstall them completely on the D drive. It saves more time and effort if you have lot of Sharepoint websites or sites with heavily customized features and code.