Restoring a demonstration site

Goal

The goal is to create a demonstration site that is automatically restored to its initial state every so often. Restoration is done automatically, without any manual intervention.

Using restore hooks

Additional to the script files, theres a hook too allow a module to provide its own programatically generated restore script, using "hook_restore_scripts" and returning an array of restore scripts: Note that the properties of the operations required depends on the operation classes.

Restore plugins

Additional operations can be added by using ctools plugins, for restore there are 3 different type of plugin classes, the operation class which deals with restoring, removing, conflicts and status checking, diff checking between the current value and the value in the restore script, and the generate UI methods for the output/input required to generate a script for a specific entity or data type.

Restore modules

There are three core modules:

  • Restore (core)
    This is the core restore module providing the classes and API.
  • Restore (differences ui)
    This module provides a UI to display any differences between the values in the database compared to the values in the restore scripts.
  • Restore (generate ui)
    This provides a UI to generate new or update existing restore scripts.

There are several operations provided by the core module:

Restore

What is restore?

Restore is a module aimed at making deployment of sites and modules easier and painless. Restore uses restore scripts to provide operation details, which can be stored as a script text file (containing a PHP array), using a hook within your own module (using arrays) or stored in the database.

Why use restore?

There are a few other modules that provide similar if not the same functionality as restore, such as Features. The current features provided by restore are as follows:

  • Text/script based restore files, to allow adding and swapping of restore scripts with modules.
  • Hooks to allow for programmatically adding and manipulating restore scripts.
  • Restore scripts can be stored in the database.
  • An admin UI to display the restore scripts and operations with the status of each element of the script(s).
  • An admin UI showing any conflicts with other scripts.
  • An admin UI to compare the the scripts values to the live values.
  • An admin UI to generate, and edit restore scripts.
  • Uses ctools to provide the operation classes.
  • The operation classes are easily built, and an example skeleton operation is provided.
Subscribe with RSS Subscribe to RSS - Restore