I recently applied a cumulative update to a SharePoint environment that hadn’t been patched in years. When I tried to upgrade the main production content database, the process failed and rendered the site inaccessible. The errors logs mentioned invalid objects such as “Webs” and “Sites”, and upon further troubleshooting we learned that because of permission issues, the content database was missing critical views and procedures due to one of the updates rolled up into the cumulative update.
NOTE: I’d like to take a moment to stress the importance of backups. CONFIRM THAT YOU HAVE A HEALTHY BACKUP BEFORE PERFORMING MAINTENANCE. EVERY. SINGLE. TIME! Thank you.
Even though we corrected the permission issues, no matter what we tried we could not re-run the upgrade to fix the problem. Instead, we had to copy those missing objects and views from the sandbox content database to prod, and cross our fingers it would work. (spoiler: it did)
- Right click your healthy database > Tasks > Generate Scripts…
- In the Choose Objects prompt, select the objects you would like to copy. In our case we copied Views and Stored Procedures.
- Click Next
- Select “Save to new query window”
- Next > Next > Finish
- Change the database in the query to the database that’s missing objects
- Execute
- Browse the site to confirm content
- Drink