Skip to main content

DokuWiki Dumper

Dynamic JSON Badge PyPI version

A tool for archiving DokuWiki.

Recommend using dokuWikiDumper on modern filesystems, such as ext4 or btrfs. NTFS is not recommended because it denies many special characters in the filename.

For webmaster

We crawl every MediaWiki site (with 1.5s crawl-delay) every year and upload to the Internet Archive. If you don’t want your wiki to be archived, add the following to your <domain>/robots.txt:

User-agent: dokuWikiDumper
Disallow: /

Our bots are running on the following IPs: wikiteam3.txt (ips, contact) | wikiteam3.ips.txt (ips)

Requirements

dokuWikiDumper

  • Python 3.8+ (developed on py3.10)
  • beautifulsoup4
  • requests
  • lxml
  • rich

dokuWikiUploader

Upload wiki dump to Internet Archive. dokuWikiUploader -h for help.

  • internetarchive
  • p7zip (7z command) (p7zip-full package)

Install dokuWikiDumper

dokuWikiUploader is included in dokuWikiDumper.

Install dokuWikiDumper with pip (recommended)

https://pypi.org/project/dokuwikidumper/

pip3 install dokuWikiDumper --upgrade

Usage

usage: dokuWikiDumper [-h] [--content] [--media] [--html] [--pdf] [--current-only] [--path PATH] [--no-resume] [--threads THREADS] [--i-love-retro] [--insecure]
                      [--ignore-errors] [--ignore-action-disabled-edit] [--trim-php-warnings] [--export-xhtml-action {export_html,export_xhtml}] [--delay DELAY]
                      [--retry RETRY] [--hard-retry HARD_RETRY] [--parser PARSER] [--username USERNAME] [--password PASSWORD] [--verbose] [--cookies COOKIES] [--auto] [-u]
                      [-g UPLOADER_ARGS] [--force]
                      url

dokuWikiDumper Version: 0.2.5

positional arguments:
  url                   URL of the dokuWiki (provide the doku.php URL)

options:
  -h, --help            show this help message and exit
  --current-only        Dump latest revision, no history [default: false]
  --path PATH           Specify dump directory [default: <site>-<date>]
  --no-resume           Do not resume a previous dump [default: resume]
  --threads THREADS     Number of sub threads to use [default: 1], not recommended to set > 5
  --i-love-retro        Do not check the latest version of dokuWikiDumper (from pypi.org) before running [default: False]
  --insecure            Disable SSL certificate verification
  --ignore-errors       !DANGEROUS! ignore errors in the sub threads. This may cause incomplete dumps.
  --ignore-action-disabled-edit
                        Some sites disable edit action for anonymous users and some core pages. This option will ignore this error and textarea not found error.But you may
                        only get a partial dump. (only works with --content)
  --trim-php-warnings   Trim PHP warnings from requests.Response.text
  --export-xhtml-action {export_html,export_xhtml}
                        HTML export action [default: export_xhtml]
  --delay DELAY         Delay between requests [default: 0.0]
  --retry RETRY         Maximum number of retries [default: 5]
  --hard-retry HARD_RETRY
                        Maximum number of retries for hard errors [default: 3]
  --parser PARSER       HTML parser [default: lxml]
  --username USERNAME   login: username
  --password PASSWORD   login: password
  --verbose             Verbose output
  --cookies COOKIES     cookies file
  --auto                dump: content+media+html, threads=3, ignore-action-disable-edit. (threads is overridable)
  -u, --upload          Upload wikidump to Internet Archive after successfully dumped (only works with --auto)
  -g, --uploader-arg UPLOADER_ARGS
                        Arguments for uploader.
  --force               To dump even if a recent dump exists on IA

Data to download:
  What info download from the wiki

  --content             Dump content
  --media               Dump media
  --html                Dump HTML
  --pdf                 Dump PDF [default: false] (Only available on some wikis with the PDF export plugin) (Only dumps the latest PDF revision)```

For most cases, you can use `--auto` to dump the site.

```bash
dokuWikiDumper https://example.com/wiki/ --auto

which is equivalent to

dokuWikiDumper https://example.com/wiki/ --content --media --html --threads 3 --ignore-action-disabled-edit

Highly recommend using --username and --password to login (or using --cookies), because some sites may disable anonymous users to access some pages or check the raw wikitext.

--cookies accepts a Netscape cookies file, you can use cookies.txt Extension to export cookies from Firefox. It also accepts a json cookies file created by Cookie Quick Manager. Bring a cookies file when the wiki requires you to be logged in (e.g. company ACLs or Keycloak/SSO frontends); the dumper loads those cookies before its first request so it can see the authenticated wiki immediately.

Dump structure

Directory or File Description
attic/ old revisions of page. (wikitext)
dumpMeta/ (dokuWikiDumper only) metadata of the dump.
dumpMeta/check.html ?do=check page of the wiki.
dumpMeta/config.json dump's configuration.
dumpMeta/favicon.ico favicon of the site.
dumpMeta/files.txt list of filename.
dumpMeta/index.html homepage of the wiki.
dumpMeta/info.json infomations of the wiki.
dumpMeta/titles.txt list of page title.
html/ (dokuWikiDumper only) HTML of the pages.
media/ media files.
meta/ metadata of the pages.
pages/ latest page content. (wikitext)
*.mark mark file.

Available Backups/Dumps

Check out: https://archive.org/search?query=subject%3A"dokuWikiDumper"

How to import dump to DokuWiki

If you need to import Dokuwiki, please add the following configuration to local.php

$conf['fnencode'] = 'utf-8'; // Dokuwiki default: 'safe' (url encode)
# 'safe' => Non-ASCII characters will be escaped as %xx form.
# 'utf-8' => Non-ASCII characters will be preserved as UTF-8 characters.

$conf['compression'] = '0'; // Dokuwiki default: 'gz'.
# 'gz' => attic/<id>.<rev_id>.txt.gz
# 'bz2' => attic/<id>.<rev_id>.txt.bz2
# '0' => attic/<id>.<rev_id>.txt

Import pages dir if you only need the latest version of the page.
Import meta dir if you need the changelog of the page.
Import attic and meta dirs if you need the old revisions content of the page.
Import media dir if you need the media files.

dumpMeta and html dirs are only used by dokuWikiDumper, you can ignore it.

Information

DokuWiki links

Other tools

License

GPLv3

Contributors

This tool is based on an unmerged PR (8 years ago!) of WikiTeam: DokuWiki dump alpha by @PiRSquared17.

I (@yzqzss) have rewritten the code in Python 3 and added some features, also fixed some bugs.

Metadata

Release files for dokuWikiDumper 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dokuWikiDumper 0.2.6
File Size Uploaded
dokuwikidumper-0.2.6.tar.gz 50.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dokuWikiDumper 0.2.6
File Interpreter ABI Platform
dokuwikidumper-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 109.8 kB

Release files / dokuwikidumper-0.2.6.tar.gz

Download URL dokuwikidumper-0.2.6.tar.gz
Size 50.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a49041fed30f41abf1a12da0da8fd5a9c7d7387d32f19ad43a4aab3f4d7e2d36
BLAKE2b-256 checksum
How to use checksums
eea6eb193ee1a947b96fbf83cd68805a4f1213fcd6ec8eeef089ff2e9a993f95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":null,"id":"forky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / dokuwikidumper-0.2.6-py3-none-any.whl

Download URL dokuwikidumper-0.2.6-py3-none-any.whl
Size 59.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dee80afd5de0c9d11731917ade594c5cb0f00ae65a1384b51cf248cdaf997117
BLAKE2b-256 checksum
How to use checksums
9e666d8c661bb242fe92d41b7707f987d13ad2db23257047f16d176f6a8fd7fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":null,"id":"forky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.46

2 release files

0.1.44

2 release files

0.1.43

2 release files

0.1.42

2 release files

0.1.41

2 release files

0.1.40

2 release files

0.1.39

2 release files

0.1.38

2 release files

0.1.37

2 release files

0.1.36

2 release files

0.1.35

2 release files

0.1.34

2 release files

0.1.33

2 release files

0.1.32

2 release files

0.1.31

2 release files

0.1.30

2 release files

0.1.29

2 release files

0.1.28

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page