Giter Site home page Giter Site logo

vincent-acrm / sugaractivitystreampurger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from esimonetti/sugaractivitystreampurger

0.0 1.0 0.0 18 KB

CLI command and a Scheduler job to purge from database old Activity Stream records

License: Apache License 2.0

PHP 100.00%

sugaractivitystreampurger's Introduction

SugarActivityStreamPurger

SugarActivityStreamPurger is a Sugar installable package containing both a CLI command and a Scheduler job to purge from database old Activity Stream records.

Configuration

It is possible to configure if the system should keep the activities relevant to linking/unlinking of records forever or not, by leveraging the following Sugar config setting:

$sugar_config['activitystreamcleaner']['keep_all_relationships_activities'] = true;

The default value is true.

It is possible to configure the amount of records that will be deleted per Scheduler run, by leveraging the following Sugar config setting:

$sugar_config['activitystreamcleaner']['limit_scheduler_run'] = 25000;

The default value is 25000 records.

It is possible to configure the number of months to keep the activities records for, by leveraging the following Sugar config setting:

$sugar_config['activitystreamcleaner']['months_to_keep'] = 6;

The default value is to keep 6 months.

It is finally possible to configure if the system should execute the SQL count of records run-time, by leveraging the following Sugar config setting:

$sugar_config['activitystreamcleaner']['count_enabled'] = false;

The default value is false, as it might take a long time to execute.
When the value is set to false, the record count is not executed by the Scheduler, but it is still enforced on the CLI command execution, unless specifically prevented via the CLI. If this value is set to true, it will be executed regardless of the use of the CLI optional parameter.

Command Line

As the first cleanup might be lenghty, it might be a possibility to complete the initial cleanup via command line, by executing the following command:

./bin/sugarcrm activitystream:cleanup

The above command will delete all records at once, without pagination and therefore it might take some time to execute.
If the sugar config value count_enabled is set to false, it is possible to prevent the command line from executing a SQL record count per table, by passing the parameter '--prevent-count'. Example:

./bin/sugarcrm activitystream:cleanup --prevent-count

Installation

  • Clone this repository and enter the cloned directory
  • Retrieve the Sugar Module Packager dependency by running: composer install
  • Generate the installable .zip Sugar module with: ./vendor/bin/package 1.2
  • Take a full backup of the instance before installing the module. Once the module is installed and the Scheduler Job is activated, older Activity Streams records will be wiped from the database forever
  • Install the generated module into the instance
  • After installing the module, activate the Scheduler job "Activity Stream Record Purger Job" under Administrator -> Schedulers and make sure the Schedulers are running correctly for the instance

sugaractivitystreampurger's People

Contributors

esimonetti avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.