Skip to content

DokuWiki Page Revisions — Changelog, Diff View, Reverting, and Cleanup

DodaTech Updated 2026-06-28 8 min read

In this tutorial, you'll learn how DokuWiki tracks page revisions, how to view the change log, compare versions using the diff viewer, revert to previous versions, and manage disk space by purging old revisions.

What You'll Learn

  • How DokuWiki stores revision history
  • Viewing the page changelog
  • Comparing versions with diff
  • Reverting to a previous version
  • Purging old revisions
  • Configuring revision retention

Why It Matters

Revision history is one of the most important features of any wiki. It provides a safety net — every edit is recorded, and nothing is permanently lost. Understanding how to use revisions means you can recover from mistakes, track who changed what, and audit the evolution of your content. Without revision management, a wiki becomes a liability instead of an asset.

Real-World Use

A content editor accidentally deletes an entire page section and saves. Another editor notices the missing content the next day. They open the page history, compare the current version with the version from two days ago, confirm the deleted content, and revert. The content is restored in seconds. No backup restoration, no IT ticket, no data loss.

Learning Path

flowchart LR
  A[Namespace Management] --> B[Page Revisions]
  B --> C[Search]
  C --> D[Categories]
  D --> E[ACL Basics]
  E --> F[User Management]

How DokuWiki Stores Revisions

When you save a page, DokuWiki does not store a full copy of every version. Instead, it stores the current page content as a .txt file and compresses old versions into .gz files in data/attic/.

data/attic/
└── projects/
    ├── roadmap.20260628.143021.txt.gz    # Old version
    ├── roadmap.20260627.091512.txt.gz    # Older version
    └── roadmap.20260625.163344.txt.gz    # Oldest version

The filename format is: pagename.YYYYMMDD.HHMMSS.txt.gz

DokuWiki also maintains a change log at data/meta/pagename.changes which records metadata about each revision:

1740611421  192.168.1.1  E  roadmap.txt  Updated Q3 milestones
1740527312  192.168.1.1  C  roadmap.txt  Created page

Each line contains: timestamp, editor, change type (C=create, E=edit, D=delete, R=revert), page ID, and summary.

Viewing the Page History

To view a page's revision history:

  1. Navigate to any page
  2. Click the "Old revisions" button (usually a clock icon or "History" link)
  3. The history page shows a table of all revisions

The history table shows:

Date Editor Summary Actions
2026-06-28 14:30 admin Updated Q3 milestones View, Revert
2026-06-27 09:15 jdoe Added timeline chart View, Revert
2026-06-25 16:33 admin Initial page View

From this view you can:

  • View: See the page as it appeared at that revision
  • Revert: Restore that revision as the current version
  • Compare: Select two revisions and click "Compare"

Comparing Versions (Diff)

The diff view shows what changed between two versions. To use it:

  1. Open the page history
  2. Check the "Compare" boxes next to two versions
  3. Click the "Compare" button at the bottom

The diff view shows:

--- Current version (2026-06-28 14:30) ++++
+++ Old version (2026-06-27 09:15) ++++

- Old text that was removed (in red)
+ New text that was added (in green)
  Unchanged text (in white)

DokuWiki uses a line-based diff, similar to Git's diff output. Added lines are highlighted in green, removed lines in red.

Understanding Diff Output

Line 12:  == Milestones ==
Line 13: - Q1: Complete research
Line 14: - Q2: Development phase
Line 15: + Q2: Development phase (extended)
Line 16: + Q3: Testing and QA
Line 17: - Q3: Deployment

This tells you:

  • Lines 13 and 17 were deleted
  • Lines 15 and 16 were added
  • Line 14 and surrounding context are unchanged

Reverting to a Previous Version

Method 1: From the History Page

  1. Open the page history
  2. Find the version you want to restore
  3. Click "Revert" next to that version
  4. Confirm the revert

DokuWiki creates a new revision with the old content and adds an "R" (revert) entry to the changelog.

Method 2: From the Diff View

  1. Open the diff between the current version and the version you want
  2. Click "Revert" at the bottom of the diff view

Method 3: Manual Restore

You can restore a page manually by decompressing an attic file:

# Decompress an old revision
gunzip -c data/attic/projects/roadmap.20260627.091512.txt.gz > data/pages/projects/roadmap.txt

This bypasses the changelog — use only if the web interface is broken.

Purging Old Revisions

Over time, attic files accumulate and consume disk space. You can purge old revisions using the bin/cleanup.php script:

php bin/cleanup.php --help

Purge by Age

# Keep revisions newer than 90 days
php bin/cleanup.php --attic --minage 90

Purge by Count

# Keep only the 10 most recent revisions per page
php bin/cleanup.php --attic --keep 10

Purge All But Current

# Remove all old revisions (keep only current version)
php bin/cleanup.php --attic --keep 1

Use this option carefully — it permanently deletes all revision history.

Dry Run Mode

# Show what would be deleted without actually deleting
php bin/cleanup.php --attic --keep 10 --dry-run

Always run a dry run first to preview the impact.

Configuring Revision Retention

You can control how many revisions DokuWiki keeps per page:

<?php
// conf/local.php
$conf['recent'] = 20;           // Number of items in "Recent changes"
$conf['recent_days'] = 365;     // Keep recent changes for 1 year
$conf['max_attic_versions'] = 50; // Max revisions per page (-1 = unlimited)

Setting $conf['max_attic_versions'] to -1 keeps unlimited revisions. Set it to 10 to keep only the 10 most recent versions per page.

The changes.log File

DokuWiki also maintains a global change log at data/changes.log. This file contains all changes across all pages:

1740611421  192.168.1.1  E  projects:roadmap  Updated Q3 milestones
1740611123  192.168.1.1  E  start             Updated welcome message
1740609921  192.168.1.1  C  team:jdoe         Created profile page

The changes.log is used for the "Recent Changes" page and the search indexer.

Common Mistakes

  1. Confusing "revert" with "undo": Reverting creates a new revision with the old content — it does not undo the last edit. The old revision and the revert are both preserved in history.
  2. Not adding summary when reverting: Always add a summary explaining why you reverted (e.g., "Reverted accidental deletion of Q3 milestones"). This helps other editors understand the change.
  3. Purging revisions without checking the impact: Once purged, old revisions are gone forever. Run a dry run first, and ensure you have a full backup before aggressive purging.
  4. Assuming revisions are backups: Revisions protect against accidental edits, but they are not a backup. If the entire data/attic/ directory is deleted, all revision history is lost. Maintain separate backups.
  5. Not configuring revision limits: Without a limit, every edit adds a gzipped copy to attic. For active wikis, this can consume gigabytes of disk space over years.

Practice Questions

  1. How does DokuWiki store page revisions, and what is the naming convention for attic files?
  2. What information is recorded in the changes.log file, and how is it different from per-page .changes files?
  3. How does the bin/cleanup.php script help manage disk space, and what precautions should you take before running it?
  4. Challenge: Create a script that audits revision storage across a DokuWiki installation. For each page, report: total number of revisions, total disk space used by attic files, oldest revision date, newest revision date, and largest revision file. Output a summary with totals and identify pages with the most revisions. The script should also suggest pages that are candidates for revision pruning.

FAQ

How long does DokuWiki keep page revisions?

By default, DokuWiki keeps revisions indefinitely. You can set a limit with $conf['max_attic_versions'] in local.php. A reasonable limit for most wikis is 20-50 revisions per page.

Can I delete a specific revision from the history?

There is no built-in function to delete a single revision. You can delete the corresponding attic file manually on the filesystem, but this is not recommended because it will break the changelog consistency.

Does reverting a page create a new revision?

Yes. When you revert, DokuWiki creates a new revision with the old content. The previous version is preserved in the attic, and the revert is recorded in the changelog. Nothing is lost.

How do I view a page as it appeared at a specific revision?

Open the page history and click the 'View' link next to the revision date. DokuWiki renders the page as it existed at that point, with a banner at the top indicating it is an old revision.

Can I compare revisions from different pages?

No. The diff view only works between two revisions of the same page. To compare content from different pages, you would need to copy the content into a separate diff tool.

Mini Project

Goal: Audit and clean up revision history.

  1. Create a test page with content, then make 5 separate edits (changing the text each time)
  2. View the page history and verify all 5 revisions are listed
  3. Use the diff view to compare two revisions
  4. Revert to the second revision and verify the content changes back
  5. Check the history again — note that the revert added a new revision
  6. Run the cleanup script with --dry-run to see how many attic files exist
  7. Configure revision retention to keep a maximum of 10 versions per page
  8. Purge old revisions keeping only the 3 most recent
  9. Verify the purged revisions are gone from the history

What's Next

Revisions protect your content. Now learn how search and indexing works in DokuWiki so users can find content quickly.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro