User Tools

Site Tools


mywiki:experience:dokuwiki

DokuWIKI Experience and skill Reference: Wiki Formatting Syntax

WIKI Directory Layout

Main Directory layout as below. For details, refer to https://www.dokuwiki.org/devel:dirlayout

  • conf – Configuration data is stored here
  • data – All data that is written by DokuWiki is stored here (see savedir)
  • attic – old page revisions are stored here, it contains namespaces directories
  • cache – DokuWiki creates cachefiles to speed things up
  • index – Stores lookup tables for the fulltext search index – No need to save, use plugin to re-generate
  • media – Here are all image files stored, it contains namespaces directories
  • media_attic– old revisions of media files
  • media_meta – meta data for media files
  • meta – Stores meta data for pages, it contains namespaces directories, the time of last update, …
  • pages – Here are the raw pages stored, it contains namespaces directories
  • auth – Authentication backends (removed since 2013-05-10 Weatherwax)

Note: If the content stored in a wiki page is data, things like the time of last update, who updated it, the filesize etc. could all be regarded as metadata for the wiki page. This page describes where and how such additional data is stored in DokuWiki. The detail meta information refer to https://www.dokuwiki.org/devel:metadata#data_structure

Backup Dokuwiki

Official proposal to backup dokuwiki: Only below two folder is a must

  • data/pages: for my wiki, it is data/pages/mywiki
  • data/media: for my wiki, it is data/media/mywiki

If need to save version history, below 4 folders are needed

  • data/meta
  • data/media_meta
  • data/media_attic
  • data/attic

Options since seldom change configuration

  • conf\acl.auth.php
  • conf\local.php
  • conf\plugins.local.php
  • conf\users.auth.php

Take note: no need to backup below folders

  • data/cached
  • data/index Note: index can be rebuild with plugin searchindex
  • data/locks
  • data/tmp
Windows_backup_script.bat
@echo off
rem place this script in the parent directory of dokuBackup folder.
IF EXIST dokuBackup (
  echo dokuBackup already exist
  echo renaming ...
  IF EXIST dokuBackup_old (
    echo are you confused? dokuBackup_old already exist!
    exit /B 1
  ) ELSE (
    move /Y dokuBackup dokuBackup_old
  )
) ELSE (
  mkdir dokuBackup
)
 
ncftpget -R -u yourUsername -p yourPassword yourWebspaceFTPurl "./dokuBackup" "yourWebSpaceFtpDokuwikiPath/data/pages/mywiki"
ncftpget -R -u yourUsername -p yourPassword yourWebspaceFTPurl "./dokuBackup" "yourWebSpaceFtpDokuwikiPath/media/mywiki"
bash_script.sh
#!/bin/sh -e
# backup data from wiki (FTP)
unset
url="ftp://example.net/"
backup="/path/to/backup"
wget -q --no-cache -nH -c -t0 --mirror -P$backup -i- <<EOF
        $url/data/pages/mywiki
        $url/data/media/mywiki
 
EOF

Upgrade Dokuwiki to Web Hosting Site

Firstly Fully delete original folders and files under dokuwiki in order to avoid old plugin mismatch and clean some old files:

  • bin
  • conf: all files except acl.auth.php, local.php, plugins.local.php, users.auth.php
  • inc
  • lib
  • vendor
  • data folder:
    • data\media\wiki
    • data\pages\wiki
    • data\pages\playground
    • data\attic
    • data\cache
    • data\index
    • data\locks
    • data\media_attic
    • data\media_meta
    • data\meta
  • all files directly under dokuwiki, like .htaccess.dist, COPYING, doku.php and so on

Secondly upload new dokuwiki unzip files/folders via ftp

Lastly reconfigure dokuwiki: dokuwiki/install.php

Skill

Function syntax Example
Escape pipe(|) %% | %% %% | %%
simple escape way to no format for single line with nowiki <nowiki>--</nowiki> <nowiki>--</nowiki>.
simple escape way to no format for a block with file <file>--</file>
a b 
simple escape way to no format for a block with file <file bash t.sh>--</file>
t.sh
ls -al 
simple escape way to no format for a block with code <code> a b </code>
a
b 
Delete words with del <del>deleted</del deleted
Create Paragraphs or forced line with \\
Valid for WIKI Table also
\\ Force line added here\\ force line1 \\ force line2 </file> Force line added here
force line1
force line2
iframe plugin test iframe example dokuwiki_html example

Admin

Secure dokuwiki in conf/local.php

Goal Setting
Disable public reset $conf['disableactions'] = 'resendpwd';
Disable register & reset $conf['disableactions'] = 'register,resendpwd';
Secure email reset (if enabled) Configure SMTP settings properly in conf/local.php

Dokuwiki Gmail SMTP configuration

Add or update the following lines:

$conf['mailfrom']     = 'youraddress@gmail.com';
$conf['mailprefix']   = '[DokuWiki] ';
$conf['smtphost']     = 'smtp.gmail.com';
$conf['smtpport']     = 587;
$conf['authsmtp']     = 1;
$conf['smtpuser']     = 'youraddress@gmail.com';
$conf['smtppass']     = 'your_app_password_here';  // NOT your Gmail password!
$conf['securemail']   = 1;  // Enables TLS

Replace youraddress@gmail.com and your_app_password_here with your Gmail and the app password from step 1.

mywiki/experience/dokuwiki.txt · Last modified: by gshao