A while back I wrote about how alerts failed to work in SharePoint 2010 after a migration from SharePoint 2007. Since then it appears that the blog entry I had linked to with sample code is no longer available.
Below is a sample console application that I used to resolve the alerts issue I experienced during the migration. Your mileage and success may vary… and please try this in a test environment first!
So what does this do? It forces an update to each of the alerts in a web applications by changing the alert title, doing an update, changing the title back and updating again. After running this utility against a problem web application my alerts began to fire off as expected.
- Disable outgoing email on your SharePoint farm before running this code. If you fail to do this your users may receive a flood of emails during this process. Once the process is complete you can enable outgoing email.
- If you moved your farm to a different URL during the upgrade / migration this will solve only part of your issues. You may still experience issues with having the wrong URL in the email alerts. To resolve this issue you will need to write code that also updates the SiteUrl property of the alert object.