1

I need to move the DokuWiki data directory away from its default location (because I keep the installation and configuration in version control, but data needs to kept elsewhere, in order to be properly backed up and not be clobbered when upgrading the software version).

How do I this? Is there a simple configuration file? Are there any gotchas?

2 Answers 2

2

I wanted to do a similar thing to keep as much writable stuff out of 'www' as possible, so moved the 'conf' and 'data' folders to a new 'wikifiles' folder.

Assuming that your paths are going to become "var/wikifiles" and "var/www/dokuwiki":

  1. Move the 'data' and 'conf' folders to 'var/wikifiles'.
  2. Do not edit 'conf/dokuwiki.php'.
    Edit 'conf/local.php' (or create it based on 'conf/local.php.dist') and set the value of $conf['savedir'] to your new path, e.g: $conf['savedir'] = '/var/wikifiles/data';.
  3. Edit or create a file called 'preload.php' in 'var/www/dokuwiki/inc' and define a path to the 'conf' folder, e.g: define('DOKU_CONF','var/wikifiles/conf/');

One gotcha would be if you're moving an existing installation, especially if it's not working as expected: Always check for 'inc/preload.php' as well as 'conf/local.php'. I always remember to do that, and totally didn't just waste a few moments staring blankly at a "The datadir ('pages') at /pages is not found" message.

1

You can change the default location of the data directory by editing /conf/dokuwiki.php

Find line 22 and look for 'savedir' below is the snippet of this entry.

$conf['savedir']     = './data';          //where to store all the files
1
  • you should not modify conf/dokuwiki.php it will be overwritten on update. Instead create a conf/local.php with the changed setting. Nov 17, 2014 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.