Store Foswiki data using plain text files
This is a full implementation of a Foswiki store that uses nothing more sophisticated than plain files and directories In the Foswiki spirit these files are organised in a simple and clear structure using intention-revealing file names.
The traditional store implementations (RcsLite and RcsWrap) use a version control methodology called. RCS uses something called "deltas" to represent the differences between successive versions of topics. This has the advantage that the store is kept reasonably small, but there are some issues with these implementations:
- Uses simple files - no shell commands used
- Incorporates script for moving between store implementations
The PlainFileStoreContrib implements topic and attachment histories by keeping a complete file for each version of the topic/attachment. This means it is less efficient in terms of disk space than RCS - at least, it is less efficient for text files; binary files, such as images, are equal. For many sites this is an acceptable tradeoff, as disk space is relatively cheap, and Foswiki doesn't use much even with this store.
- RcsWrap invokes external programs. These are reasonably fast, but can cause major performance problems when used with a web server accelerator, such as
mod_perl. Most sites using accelerators therefore use:
- RcsLite, which is a pure-perl implementation of RCS. This doesn't use any external programs but is very inefficient with topics that have large numbers of versions.
The latest rev also has a history file (note: this means that
everything is stored at least twice; same as in the RCS stores)
- Webs map to directories, like in the RCS stores
- Topics are stored in
data/web/topic.txt, like in the RCS stores
- Topic histories are in
- Attachments are in
pub/web/topic/attachment, like in the RCS stores
- Attachment histories are in
- Meta-data is stored in a separate file
- Histories consist of files numbered for the revision they store (each with a corresponding metafile)
Developers note: this contrib is tested using the standard store unit tests.
- Automatic attachment of files placed in pub directories is not supported for performance reasons.
- Mapping the 'TWiki' web to the Foswiki 'System' web (as required for the TWikiCompatibilityPlugin) is not supported. If you require TWiki compatibility, use one of the RCSStoreContrib stores.
Moving between store implementations
Foswiki < 2.0
tools/bulk_copy.pl script (part of the Foswiki 2.0 release package, or available from github or ) allows you to move between different store implementations. Do not share data areas between different store implementations.
Testing is performed using the standard system tests. Because some
of these tests are written assuming a broken store (the RCS based stores
have problems with "inconsistent topics") they are known to fail with
the PlainFileStore. The tests that are relevant to this store are:
A subset of the VC* store tests may also be run as a sanity check,
but expect failures as this store maintains a correct version history,
unlike the RCS stores.
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button.
Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the
You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
perl tools/extension_installer <NameOfExtension> install
If you have any problems, or if the extension isn't available in
configure, then you can still install manually from the command-line. See https://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Many thanks to the following sponsors for supporting this work