DokuWiki Page Revisions — Changelog, Diff View, Reverting, and Cleanup
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:
- Navigate to any page
- Click the "Old revisions" button (usually a clock icon or "History" link)
- 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:
- Open the page history
- Check the "Compare" boxes next to two versions
- 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
- Open the page history
- Find the version you want to restore
- Click "Revert" next to that version
- 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
- Open the diff between the current version and the version you want
- 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
- 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.
- 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.
- 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.
- 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. - 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
- How does DokuWiki store page revisions, and what is the naming convention for attic files?
- What information is recorded in the
changes.logfile, and how is it different from per-page.changesfiles? - How does the
bin/cleanup.phpscript help manage disk space, and what precautions should you take before running it? - 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
Mini Project
Goal: Audit and clean up revision history.
- Create a test page with content, then make 5 separate edits (changing the text each time)
- View the page history and verify all 5 revisions are listed
- Use the diff view to compare two revisions
- Revert to the second revision and verify the content changes back
- Check the history again — note that the revert added a new revision
- Run the cleanup script with
--dry-runto see how many attic files exist - Configure revision retention to keep a maximum of 10 versions per page
- Purge old revisions keeping only the 3 most recent
- 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