Editing the Dokuwiki Authorstats

If a Dokuwiki Installation is used with an Active Directory, user names and accounts may change. In code, the Authorstats plugin reads Dokuwikis meta folder containing all information about site edits and creations, and generates the Authorstats table from it. For this, every unique string at the user name position is seen as an account, and listed separately in the table.

This means that after any change in user name, no matter if through individual modification, a new naming convention or switching to a different Active Directory, all edits from this point on are tracked as a new user. To avoid this and keep all pervious edit statistics even after a name change, the Authorstats plugin and Dokuwiki offer no obvious solution. The following can be done manually to migrate old meta entries to a new user:

Ordered List ItemThe meta directory under “installation_path/data/meta” needs to be opened.

In the entire directory, all occurences of the old username need to be searched for and exchanged for the new username. For example, this can be done with a code editor like VS Code, which can exchange one string for another in the entire directory.

As the Authorstats plugin generates cache files for the contribution inforation, said files need to be deleted for the changes to take effect. For this, the “_authorstats” folder under “installation_path/data/cache” has to be deleted.

After deleting the authorstats cache, the wiki website may take a few seconds to load, as the cach files need to be regenerated.

The contribution stats of the old account have now been merged with the new account :)

Side note: As this method replaces all contribution data of the old account, it also affects all information contained in the changelogs for each site. This means that from an internal perspective, all records of the old account are overwritten, even from a time where the new account didn't exist yet. If this is problematic, please refrain from following this tutorial. Right now, there seems to be no other way the fix the contributions table.