Skip to content
Igor Zhutaiev edited this page Sep 21, 2016 · 18 revisions

What is Tidbit?

Tidbit is a data generation tool for the Sugar application.

Tidbit Tutorial

This tutorial will guide you step-by-step through the process of installing and running Tidbit. The only requirement is a working installation of Sugar.

Install composer

Download and install composer (as phar)

$ curl -sS https://getcomposer.org/installer | php

Useful docs: https://getcomposer.org/doc/00-intro.md

Step 1: Installing Tidbit

Installation with Composer

Inside project (as dependency)

$ composer require sugarcrm/tidbit

Global installation (to User home directory)

$ composer global require sugarcrm/tidbit

Make sure, you’ve added global available packages to your PATH

export PATH=~/.composer/vendor/bin:$PATH

Installation from Github

To download Tidbit, first `cd` to the root directory of your Sugar installation. Then:

$ git clone git://github.com/sugarcrm/Tidbit.git

This will create a ‘Tidbit’ directory in your Sugar installation’s root directory.

Install composer dependencies inside Tidbit directory

$ composer install

Step 2: Run Tidbit command line script

Please note that examples are using

./bin/tidbit
. When Tidbit installed globally just
tidbit
should be used. If Tidbit is part of your application (installed as dependency) – please use
./vendor/bin/tidbit

First, ‘cd’ to your Tidbit directory. The command-line interface script for Tidbit is ./bin/tidbit. Here’s a simple usage example:

$ ./bin/tidbit -l 10

This uses a ‘load’ factor of 10, meaning that 10 Accounts will be created, and records in other modules will be created in proportion to that number of accounts. The ratios are controlled by the values in the $modules array, located in config/config.php.
$modules is an array that maps module names to integer values. The default settings map ‘Accounts’ to 1000 and ‘Contacts’ to 4000, so 4 Contacts will be created for every 1 Account.

Another example:

$ ./bin/tidbit -o —profile simple —sugar_path /path/to/your/sugar/installation

Tidbit will use existing “simple” config to get amount of records for each module, that need to be generated.
—sugar_path is used to specify Sugar installation location.

$ ./bin/tidbit -l 50 -o —allmodules —allrelationships

Like in the prior example, we use a ‘load’ argument. The ‘-o’ flag is for ‘obliterate’ mode. This will erase all data in tables populated by Tidbit before creating new data.
The ‘—allmodules’ flag tells Tidbit to generate records for any custom modules built using Module Builder. The ‘—allrelationships’ flag tells Tidbit to generate relationships between the records it creates whenever possible.

For a complete listing of command line options, you can display the usage string with the following:

$ ./bin/tidbit -h

Documentation of command line options can be found in this article.

DONE: Sugar is ready for testing!

If you now open Sugar in your browser you will see it is populated with CRM data. It is ready for you to perform your testing!

Useful Articles how to extend or change Tidbit