Community Documentation

Using restore scripts

Last updated February 21, 2013. Created by Orgun109uk on February 21, 2013.
Log in to edit this page.

In order to use a generated script file, you still need a module to provide it, this will usually be in either an existing module you have built for the site, or an empty module specific for the scripts. In this module you just need a single hook to tell restore where to look:

<?php
/**
* Implements hook_restore_scripts_location().
*/
function MY_MODULE_restore_scripts_location() {
 
// This can be any location required, but in this example we are using [MY MODULE]/restore-scripts.
 
return drupal_get_path('module', 'MY_MODULE') . '/restore-scripts';
}
?>

Once the module has been setup, all you need to do is place any or all of your restore scripts into the defined scripts folder (in the example its [MY MODULE]/restore-scripts) and restore will find them. An example module is provided showing this usage, "restore_example_script" in the module/examples folder.

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 7.x
Keywords
Restore scripts

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here