How do I backup a Foswiki installation
The Foswiki system stores data files and attachments on disk in a simple directory structure. On most installations, backup is as simple as using a system backup tool to copy the Foswiki directory structure to the desired backup location. Also, the Foswiki system itself is fairly lightweight, so many sites backup the entire Foswiki installation an not just the user data directories.
What do I have to back up?
Caution: Some packaged installations use non-standard directory locations. The below structure applies to the standard "Tar" or "Zip" installation of Foswiki. Also note that file paths can be overridden in the
lib/LocalSite.cfg
file, so
the below paths may be different on your installation.
The Foswiki directory structure consists of:
|
foswiki |
|
|
bin server executable scripts |
|
|
data User topics and Foswiki logs |
|
|
lib Foswiki and Plugin code, and the Foswiki system configuration |
|
|
locale International language support |
|
|
pub User attachments |
|
|
templates Foswiki layout and rendering information |
|
|
tools utility scripts |
|
|
working temporary, and internal information needed by some plugins |
The
data
and
pub
directories are sufficient to get all user topics and attachments, however
all the
bold
directories should generally be backed up and restored if full operation is desired.
- Some Extensions add scripts to the
bin
directory. Also, the scripts in bin
may have been customized if your perl
is not found in /usr/bin/perl
, typically on Windows.
- The
lib
directory contains the Foswiki configuration file ( LocalSite.cfg
) and any installed Extensions.
- The
templates
directory might be modified for local customizations and may contain files installed by Extensions.
- The
tools
directory also might contain programs installed by Extensions, such as the MailerContrib, and GenPDFAddOn.
- The
working
directory has critical information for the MailerContrib for example, so that users receive only the most recent changes. It also might contain critical plugin information like Topic Tags for the TagMePlugin, and hash files for the DirectedGraphPlugin.
As can be seen, the safest route is to back up and restore the entire Foswiki installation.
Other Considerations
Some Extensions use databases or non-standard file locations for external storage. These need to be individually considered in your backup strategy.
Below is a short list of typical backup tools. Documentation of the chosen tool should be referenced for more detailed instructions. And backups should always be tested to ensure that all required files have been backed up, and restored.
On Linux and Unix like platforms, there are a number of common tools available including
- The unix "archive" tool - tar
-
tar -cjvf
<backup_file> <Foswiki_Installation>
- Remote backups using "rsync" (rsync will copy only the changed files)
- rsync -avz <Foswiki_Installation> <user@backup_server:/backup/foswki>
- Archives using tar over a ssh pipe to a remote location (handy if insufficient disk space locally for backup)
-
tar zcvf -
<Foswiki_Installation> | ssh user@backup_server "cat > /backup/foswiki_bkup.tgz"
Windows
Mac
On Mac, most of the Linux and Unix like platforms tools are available:
- Remote backups using "rsync" (rsync will copy only the changed files)
- rsync -avz -e ssh remoteuser@remotehost:/remote/foswikidir /local/dir - Ssh access is supposed in this example. For additional information about automating it see http://troy.jdmz.net/rsync/index.html