On Fri, Jun 1, 2012 at 3:30 PM, Vincent Massol
<vincent(a)massol.net> wrote:
Hi devs,
This proposal is a restart of the thread I've sent, entitled "[Proposal]
XWiki's Permanent Directory Strategy for Installations" in which I wasn't
clear.
Executive Summary
================
Define 2 XWiki directories; one for holding configuration data and one for holding
(permanent) data and allow various configurations for our distributions.
* Config dir is where xwiki configuration files is located. Examples: xwiki.cfg,
xwiki.properties, hibernate.cfg.xml
* Data dir is where xwiki writes permanent data. Examples: database/, extension/ lucene/,
jetty log files
Rationale
========
This proposal below tries to answer the following general use cases:
* Ability to easily backup an XWiki install
* Ability to easily upgrade an XWiki install
* Ability to install XWiki on various OSes, including OSes like Windows 7 which require a
total separation of readonly binaries and generated data
* Ability to have several instances of XWiki on the same machine
Note that I'm sending this email since I'm currently working on making our
installer work on Windows 7 and I need an agreement on this before I can continue since
I'm currently blocked.
Use Cases
=========
The proposal below should allow the following use cases easily:
UC1: use the standalone zip distribution
UC2: upgrade a standalone zip distribution install
UC3: Use the WAR production distribution
UC4: Upgrade an existing WAR distribution
Short Term Proposal
=================
* Add 2 system property variables: xwiki.config.dir and xwiki.data.dir
* Use the following algorithm for resolving the Config dir (in Environment Module):
** Check if system property xwiki.config.dir is set, if so, use it
** Otherwise default to the WEB-INF directory (same as now)
* Use the following algorithm for resolving the Data dir (in Environment Module):
** Check if system property xwiki.data.dir is set, if so, use it
** Otherwise use value of environment.permanentDirectory in xwiki.properties (same as
now)
** If no environment.permanentDirectory exists, then use the temporary directory (same as
now)
* Don't provide a default value for environment.permanentDirectory in
xwiki.properties
* Note that we probably need to modify a bit Environment module to add support for a
Configuration directory (not sure yet about this need).
Use Cases Walkthrough
===================
UC1:
* user unzips, that's all
* in start/stop xwiki scripts we use xwiki.config.dir = [homedir]/config and
xwiki.data.dir=[homedir]/data
There is something missing here. XWiki is not going to find anything
in [homedir]/config obviously when starting so how does he knows about
proper hsqldb configuration for example ? Is the configuration copied
from the war the first time it starts ?
The zip contains everything. Its structure would be:
[homedir]/
|_ data/
|_ config/
|_ jetty/
|_ webapps/
|_ start_xwiki.sh
|_ …
In the start/stop shell scripts, we will have: -Dxwiki.data.dir=data and
-Dxwiki.config.dir=config
Hope it's more clear :)