Backuping A Repository

where zip is the name of the file to generate, backup.xml, the name of the XML configuration file (if you don't know how to use it, please use the one included), login and password: the required userID and password.

Restoring

To restore a repository, please prepare a blank repository (available through create repository)

where zip is the name of the backup file, backup.xml, the name of the XML configuration file (if you don't know how to use it, please use the one included), login and password: the required userID and password.

repository.xml and repository/ respectively points toward the repository.xml file and its home to restore.

NB You can easily migrate one repository to the other this way and change PersistenceManager easily.

Architecture

We tried as much as possible to achieve a symmetry between backup and restore. All classes can be used for backup and restore operations.

The backup tool is organized in main classes:

Launch utility (LaunchBackup) The launch utility allow to launch a backup through a cronjob or the CLI. You can also integrate the backup in your application by instantiating this class.

<Resource>Backup It is a collection of classes extending the abstract class Backup. Each class is responsible for backuping/restoring a specific resource. For instance, NodeTypeBackup is responsible to backup and restore all node types. To create another class (for instance to backup Lucene indexes), extend Backup and implement its two abstract methods: backup and restore. If you do so, please commit them back.

Manager manages the instanciation and handling of all <Resource>Backup classes (please see NB). It knows which Backup subclasses to call through a XML configuration file. You can therefore create easily your own customized backup.

IOsystem The IOsystem is handled through an interface (BackupIOHandler) and its implementation (ZipBackupIOHandler). It allows us to easily improve the IOsystem without impacting other parts of the code.

NB The restore operation of the backup configuration and the repositories are special since they are mandatory and allow the restore operations to take place. Therefore, LaunchBackup is calling those two classes directly in order to be able to continue the restore operation.