Rollback Management Script

Last Updated: 02 Apr 2019

Please note that as of version 5.5.0.0 of Matrix, the functionality described on this page has been deprecated.

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.

An example usage of this script is show below:

USAGE: rollback_management.php -s [system_root] [-d <date>] [-p <period>] [--enable-rollback] [--disable-rollback] [--reset-rollback] [--delete-redundant-entries] [-q --quiet]
--enable-rollback Enables rollback in Squiz Matrix
--disable-rollback Disables rollback in Squiz Matrix --reset-rollback Removes all rollback information and enables rollback in Squiz Matrix
--delete-redundant-entries Removes all the unnecessary Scheduled Jobs Manager asset rollback entries -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.

Disabling Rollback

Configuration Settings

To disable rollback, you must first change the SQ_CONF_ROLLBACK_ENABLED configuration parameter in the system's main.inc configuration file from true to false.

 define('SQ_CONF_ROLLBACK_ENABLED', '0'); 

For more information on Squiz Matrix's configuration settings, refer to the Annotated main.inc chapter in this manual.

Disable Database Triggers

Rollback is controlled through triggers on the database that copy data to history tables, as it is modified. Disabling the system's rollback configuration setting will not stop these triggers from saving old versions of data; this must be done manually.

To disable the rollback database triggers, run the step_02.php installation script, as follows:

$ php install/step_02.php /path/to/matrix

Disable Rollback Data

You will then need to disable rollback on the database by running the rollback_management.php script, like so:

$ php scripts/rollback_management.php -s /path/to/matrix --disable-rollback 

Rollback will now be disabled on your system.

Enabling Rollback

Configuration Settings

To enable rollback, you must first change the SQ_CONF_ROLLBACK_ENABLED configuration parameter in the system's main.inc configuration file from false to true.

define('SQ_CONF_ROLLBACK_ENABLED', '1'); 

For more information on Squiz Matrix's configuration settings, refer to the Annotated main.inc chapter in this manual.

Initialise Rollback Data

You will then need to initialise the rollback data stored in the database, to the current date and time. This is done by running the rollback_management.php script, like so:

$ php scripts/rollback_management.php -s /path/to/matrix --enable-rollback

Enabling the Database Triggers

Rollback is controlled through triggers on the database that copy data to history tables, as it is modified. Enabling the system's rollback configuration setting will not automatically (re-)create these triggers; this must be done manually.

To enable the rollback database triggers, run the step_02.php installation script, as follows:

$ php install/step_02.php /path/to/matrix


Rollback will now be enabled on your system.

Resetting Rollback

The process of resetting rollback will delete all existing rollback date on the system, essentially resetting the rollback system to the current date and time. This process should be completed after a MINOR version upgrade of Squiz Matrix. For example, if you are upgrading from Matrix 5.3.x.x to 5.4.x.x.

Please note that resetting rollback will delete all existing rollback data permanently. This data will not be recoverable. Ensure that you have made a backup of your system before resetting this rollback data.

Configuration Settings

To reset rollback, you must first change the SQ_CONF_ROLLBACK_ENABLED configuration parameter in the system's main.inc configuration file from false to true.

define('SQ_CONF_ROLLBACK_ENABLED', '1'); 

For more information on Squiz Matrix's configuration settings, refer to the Annotated main.inc chapter in this manual.

Resetting Rollback Data

The existing rollback data stored in the database needs to be deleted and initialised with new live data. This ensures rollback is restarted from the current date and time.

To reset the rollback data, run the rollback_management.php script, like so:

$ php scripts/rollback_management.php -s /path/to/matrix --reset-rollback 

Enabling the Database Triggers

Rollback is controlled through triggers on the database that copy data to history tables, as it is modified. Enabling the system's rollback configuration setting will not automatically (re-)create these triggers; this must be done manually.

To disable the rollback database triggers, run the step_02.php installation script, as follows:

$ php install/step_02.php /path/to/matrix

Rollback will now have been reset and enabled on the system.


Previous Chapter Next Chapter