Troubleshooting WordPress Failed Updates
After a new installation of WordPress in Microsoft Internet Information Services (IIS), or as in my case, after the migration of your WordPress IIS site, you may come across an error while trying to update Plugins, Themes, etc.
It appears that everything downloaded and installed properly until it tried to remove the old theme/plugin/etc. A failure then occurred, “Could not remove the old theme” causing the update to fail.
We turn to Process Monitor to try and track down what appears to be a permissions issue. After opening Process Monitor, make sure you are only showing file system activity by clearing the icons in the icon menu bar and only leave the one on that looks like a file cabinet.
Next we want to setup a highlight to make it easier to track down our issue. Go to Filter -> Highlight… and setup a filter where the Result contains Access Denied and Include those results.
Get your WordPress Control Panel ready to try an update again. Start Process Monitor and then attempt to do another update. Once it fails, stop Process Monitor. Now you want to look for highlighted entries and see if they match up with your site and the time of your testing.
Double click one of the highlighted lines and you should be able to view the properties of it, similar to what I show in the screen shot. You can see that the ACCESS DENIED is occurring while it is impersonating NT AUTHORITY\IUSR.
Go to the file system and open the properties of the root folder for the site. Add IUSR and give it modify permissions.
You should now be able to update WordPress.