Rebuild node permissions table on large sites with many nodes
Every now and again the node permissions table on a Drupal site can go out of whack. The result is that some users may get an accessed denied message when trying to access pages.
This is fairly easy to fix on a "normal size" website. You simply go to admin -> content -> post settings and click "Rebuild permissions".
However, this does not always work on a partcularly large Drupal based website. I have tried this on a site with around 11,000 nodes and it times out, giving me a page not found error.
One solution is to use a custom script to rebuild the node permissions one node at a time. I found this script on drupal.org:
Thanks to enboig for the script.
I have used it on the site with 11,000 nodes and it works like a treat. Although it does take a long time to run. In this case, it took several hours. But at least it worked!
New comments for this tutorial have been turned off.