Mobile app version of vmapp.org
Login or Join
Courtney195

: Move the DokuWiki data directory somewhere else? I need to move the DokuWiki data directory away from its default location (because I keep the installation and configuration in version control,

@Courtney195

Posted in: #Dokuwiki

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Courtney195

2 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera270

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":


Move the 'data' and 'conf' folders to 'var/wikifiles'.
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';.
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.

10% popularity Vote Up Vote Down


 

@Nimeshi995

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme