Rollback Management Script

The rollback_management.php script manages rollback and is used to enable rollback if you did not enable rollback during installation. It adds entries into rollback tables for assets that were created prior to rollback being enabled, which can be a lengthy process.

The script also allows you to clean out any old rollback entries that you no longer want to keep. For example, you can purge all rollback entries older than 2 weeks.

Before running the script, you must manually edit the following /home/websites/squiz_matrix/data/private/conf/main.inc to activate or deactivate rollback. Change the file as follows:

  • To enable rollback
    define('SQ_CONF_ROLLBACK_ENABLED', '1');
  • To disable rollback
    define('SQ_CONF_ROLLBACK_ENABLED', '0');

Next run the following script to update the database tables:

php /home/websites/squiz_matrix/install/step_02.php /home/websites/squiz_matrix

Now run rollback_management.php. An example of the usage of rollback_management.php is show below.

USAGE: rollback_management.php -s [system_root] [-d <date>] [-p <period>] [--enable-rollback] [--disable-rollback] [-q --quiet]
--enable-rollback Enables rollback in Squiz Matrix
--disable-rollback Disables rollback in Squiz Matrix -q No output will be sent
-d The date to set rollback entries to in the format YYYY-MM-DD HH:MM:SS
-p The period before which to purge the database rollback entries in the format nx where n is the number of units and x is one of:
     h - hours
     d - days
     w - weeks
     m - months
     y - years
-f This parameter purges old file versioning files and history entries beyond a certain period. All current file versioning files will remain.The period is specified in the same way as for ‘-p’ described above. For example:
    php scripts/rollback_management.php –s . –f 2w
Will purge all old file versioning files and history entries that are more than two weeks old. 

Only one of [-d -p -f --enable-rollback --disable-rollback] options can be specified.

Usage of the script can be viewed by running the script without any arguments. The script can only be run from the command line.

PreviousNext