User Tools

Site Tools


org:wiki_-_backup

Creating a Complete Backup

This guide explains how to prevent changes to the DokuWiki-based FlatPress Wiki, create a complete backup by SFTP or passive FTP, verify the files, and test restoration in an isolated environment.

DokuWiki normally stores its content in files and does not require an SQL database. The simplest complete backup is therefore a copy of the entire DokuWiki installation directory. If the data directory or plugin data is stored elsewhere, those locations must be backed up separately.

Important: A backup should only be considered reliable after it has been verified and, ideally, restored successfully in a test environment.

1. Preparation

Before starting:

  • Verify administrator access to the wiki.
  • Have SFTP, FTPS, or FTP credentials ready.
  • Ensure sufficient local storage is available.
  • Record the DokuWiki, PHP, and web-server versions.
  • Do not update DokuWiki, plugins, or templates during the backup.
  • Choose an unambiguous backup name.

Example:

flatpress-wiki-backup_2026-06-28

2. Scope of a complete backup

The safest approach is to copy the entire DokuWiki installation directory. It typically contains:

conf/
data/
inc/
lib/
vendor/
bin/
doku.php
feed.php
index.php
.htaccess
web.config
VERSION
COPYING
README

Individual files or directories may differ depending on the version and hosting environment.

Especially important components:

Path Content
conf/ Local configuration, users, ACL rules, and plugin settings
data/pages/ Current wiki pages
data/attic/ Older page revisions
data/media/ Uploaded media
data/media_attic/ Older media revisions, if used
data/meta/ Page metadata
data/media_meta/ Media metadata
data/index/ Search index
data/cache/ Cache files
data/locks/ Editing locks
data/tmp/ Temporary files
lib/plugins/ Installed plugins
lib/tpl/ Installed and customized templates
.htaccess / web.config Web-server rules and access protection

Cache, index, lock, and temporary files can partly be regenerated. Copying the complete directory is nevertheless the simplest way to create a complete snapshot.

3. Check the data directory and external paths

The displayed FlatPress Wiki configuration uses:

savedir = ./data

This means that data/ is located inside the DokuWiki installation directory.

Check it in the Configuration Manager:

Administration
  -> Configuration Settings
    -> DokuWiki
      -> Basic
        -> Directory for saving data

Also inspect conf/local.php and look for:

$conf['savedir']
Setting Backup consequence
./data Included with the installation directory.
another relative path Locate and back up the actual target directory.
an absolute path Back up the external data directory separately.
no local setting The default data/ directory is normally used.

Also check for:

  • symbolic links;
  • external plugin data paths;
  • external authentication sources;
  • manually linked media directories;
  • custom scripts and scheduled jobs.

FTP clients do not necessarily follow symbolic links. Back up their targets separately where required.

4. Prevent changes during the backup

DokuWiki does not provide a single standard maintenance-mode switch comparable to phpBB.

4.1 Recommended: block access at web-server level

The safest option is a temporary restriction such as:

  • directory password protection in the hosting control panel;
  • a temporary maintenance page;
  • access limited to the administrator's IP address;
  • a temporary .htaccess or web-server rule.

This method also prevents writes made through plugins.

4.2 Alternative: make DokuWiki largely read-only

Open:

Administration
  -> Configuration Settings
    -> Authentication
      -> Disable DokuWiki actions

Disable at least:

Register
Edit this page

For a broader restriction, also disable where appropriate:

Update Profile
Set new password
Delete Own Account
Subscribe/Unsubscribe

In:

Other actions (comma separated)

enter:

media

This disables the ?do=media action and therefore normal access to the Media Manager. Existing media embedded in pages remains visible.

The resulting setting may be stored internally in a form similar to:

$conf['disableactions'] = 'register,edit,media';

Do not accidentally overwrite existing entries.

Limitation: Plugins may provide their own write functions. A web-server-level block is more reliable when maximum consistency is required.

4.3 Verify the restriction

Open the wiki in a private/incognito browser window and check:

  • Edit this page is unavailable.
  • Media Manager is unavailable.
  • Direct access using ?do=media is blocked.
  • Registration is unavailable.
  • No administrative changes are made during the backup.

5. Back up by SFTP or passive FTP

5.1 Choose the protocol

Recommended order:

  1. SFTP;
  2. FTPS;
  3. plain FTP only if no secure alternative is available.

Passive FTP mode only changes how the data connection is established. It does not change the scope of the backup.

5.2 Configure the FTP client

Setting Recommended value
Connection mode Passive
Transfer mode Binary or automatic without content conversion
Show hidden files Enabled
Preserve timestamps Enabled, if supported
Retry failed transfers Enabled
Concurrent connections Moderate
ASCII conversion Disabled

5.3 Download the entire installation directory

  1. Open the root directory of the DokuWiki installation.
  2. Make hidden files visible.
  3. Select the complete installation directory.
  4. Download every file and subdirectory.
  5. Inspect the transfer log for errors.
  6. Retry failed or skipped files.
  7. Keep the maintenance or write restriction active until the transfer is complete.

Do not back up only data/. A complete restore also requires configuration, users, ACL rules, plugins, templates, and application files.

5.4 Back up external paths

If savedir, plugin data, or symbolic-link targets are located outside the installation:

  • download them completely;
  • document their original locations;
  • record permissions and ownership;
  • document symbolic links.

6. Create a local archive

Recommended names:

flatpress-wiki-files_2026-06-28.tar.gz

or:

flatpress-wiki-files_2026-06-28.zip

Store the archive outside the downloaded wiki directory.

Also create backup-notes.txt:

Backup date:
DokuWiki version:
PHP version:
Web server:
Source path:
savedir:
Transfer method:
External paths:
Maintenance restriction used:
Number of files:
Total size:
Verification result:

7. Verify the backup

7.1 Verify the transfer

  • Check the FTP/SFTP log for errors.
  • Retry failed transfers.
  • Compare file counts and total size.
  • Confirm that hidden files were copied.
  • Test or fully extract the archive.
  • Open sample files from conf/, data/pages/, data/media/, lib/plugins/, and lib/tpl/.

7.2 Check minimum contents

At least the server's existing equivalents of the following should be present:

conf/local.php
conf/acl.auth.php
conf/users.auth.php
data/pages/
data/attic/
data/media/
data/meta/
lib/plugins/
lib/tpl/
doku.php

Not every installation uses acl.auth.php or users.auth.php. Their absence may be correct when external authentication is used.

7.3 Create a SHA-256 checksum

Linux or macOS:

sha256sum flatpress-wiki-files_2026-06-28.tar.gz

PowerShell:

Get-FileHash .\flatpress-wiki-files_2026-06-28.zip -Algorithm SHA256

Store the checksum separately in SHA256SUMS.txt.

8. Test restoration

Never test restoration by overwriting the production installation.

8.1 Prepare a test environment

  • Create a separate test web directory.
  • Use a compatible PHP version.
  • Prevent public access.
  • Use an empty destination directory.

8.2 Restore

  1. Extract the archive into the test directory.
  2. Restore external savedir or plugin directories to the documented locations.
  3. Apply the required file permissions.
  4. Correct owner and group where possible.
  5. Adjust basedir, baseurl, or other environment-specific values only in the test copy.
  6. Clear the cache if required.

8.3 Validate functionality

Test at least:

  • start page;
  • administrator login;
  • ACL permissions;
  • navigation and sidebar;
  • pages and revisions;
  • media and Media Manager;
  • search;
  • plugins;
  • template;
  • editing and saving;
  • internal links and downloads.

The test copy contains production data and must be deleted or protected afterwards.

9. Re-enable the wiki

After the download and verification are complete:

When using a web-server block

  1. Remove the directory password or maintenance rule.
  2. Open the wiki in a private/incognito browser window.
  3. Test login, reading, and editing.

When using disabled DokuWiki actions

Undo only the restrictions added for the backup:

  • allow Edit this page again;
  • remove media from Other actions;
  • re-enable other actions disabled only for the backup;
  • keep permanent restrictions such as disabled self-registration unchanged.

Then test editing, Media Manager, uploads, login, and plugins.

10. Secure storage

A backup may contain usernames, password hashes, email addresses, private pages, ACL rules, plugin configuration, and server paths.

Therefore:

  • encrypt archives or backup media;
  • restrict access;
  • keep at least one copy outside the web server;
  • use multiple separate storage locations;
  • define a retention schedule;
  • securely delete expired backups;
  • schedule regular restoration tests.

Recommended backup set:

flatpress-wiki-files_YYYY-MM-DD.tar.gz
SHA256SUMS.txt
backup-notes.txt

11. Checklist

  • [ ] Administrator and SFTP/FTP access verified
  • [ ] Versions documented
  • [ ] savedir checked
  • [ ] External paths and symbolic links checked
  • [ ] Web-server or write restriction enabled
  • [ ] Edit this page disabled
  • [ ] media action disabled
  • [ ] Restriction tested as a visitor
  • [ ] Hidden files visible
  • [ ] Entire installation directory downloaded
  • [ ] External paths backed up
  • [ ] Transfer errors checked
  • [ ] Archive created and tested
  • [ ] SHA-256 checksum created
  • [ ] Protected off-server copy stored
  • [ ] Restoration test completed or scheduled
  • [ ] Restriction removed
  • [ ] Wiki functionality verified again

12. Sources

org/wiki_-_backup.txt ยท Last modified: by fraenkiman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki