DokuWiki Recovery Script
Whenever you touch a running system, there's potential for something to break. This is true for DokuWiki as well. May it be a DokuWiki update, upgraded plugins, a config change or a system update, it can happen that something goes wrong.

One of the worst cases is when your wiki becomes inaccessible. Either because there is some fatal error or because the error simply keeps you from logging in.

Especially novice users are often completely lost in that case.

This weekend I built a tool that can help making a wiki accessible again. It's a single script that you can upload to your server if everything else failed.

It does two things:

  • help troubleshooting the environment
  • reset the wiki configuration to a minimal state

The first part is simply is a more detailled version of what the DokuWiki installer, the ?do=check command and the upgrade plugin already do. It checks the environment (like the PHP version or if certain needed functions are available) and tells you what is wrong. The script will give a very short hint on how to fix problems and link to dokuwiki.org where more detailed help can be provided.

BTW: Later I want to reuse the class for all these checks in DokuWiki and the upgrade plugin. The idea is to have a single class that ensures the environment is ready for DokuWiki and reuse it in different places. But that will come later. For now it's only in the dokuwiki-recovery script.

The second part is what may help to actually recover a broken wiki. The idea came from DokuWiki user Michael Symonds who suggested introducing a "DokuWiki safe mode". That's basically what this part of the script does. It disables all but the minimal needed plugins, resets the wiki to English and the standard template, and creates a new super user you can login with using the plainauth backend.

That should be enough to get you back into the wiki and start fixing.

The script is available from Github.

I think this script has potential to get extended with more trouble shooting tools. If you have ideas, feel free to send a pull request or open an issue.