SugarCRM SupportProduct GuidesSugar Versions10.010.0 ProfessionalSugar Professional 10.0 Administration GuideSystemRepair



The repair functions in Sugar allow administrators to perform common maintenance routines on their instance of Sugar. The repair menu is available to only administrative users and can be accessed through Admin > Repair. The following sections are available options from the repair menu.

Quick Repair and Rebuild

The quick repair and rebuild is the most commonly used repair option and should be performed after significant changes have been made to your instance of Sugar. If you notice inconsistencies with module layouts or fields as you have customized them via Studio, this option is normally the best first course of action to try and correct the issue. Sugar caches files to help access necessary files quickly. This option clears out many of the cached files in Sugar which allows new versions of the files to be loaded. The quick repair and rebuild option performs the following actions:

  • Clear Vardefs From Cache : Deletes any *vardefs.php file in the cached modules folder
  • Clear Language Files From Cache : Deletes any {Module Name}.lang.php file in the cached modules folder
  • Clear Template Files From Cache : Deletes any *.tpl files in the cached modules folder
  • Clear JavaScript Files From Cache : Deletes any *.js files in the cached modules folder
  • Clear JavaScript Language Files From Cache : Deletes any *.js files in the cached jsLanguage folder
  • Clear Dashlet Files From Cache : Deletes any *.php files in the cached dashlets folder
  • Clear Sugar Feed Files From Cache : Deletes the Sugar Feed files in cached modules folder
  • Clear Smarty Template Files From Cache : Deletes any *.tpl.php files in the cached smarty templates folder
  • Clear Theme Files From Cache : Deletes theme files in the cached theme folder for all themes in Sugar
  • Clear XML Files From Cache : Deletes any *.xml files in the cached xml folder
  • Clear Search Files From Cache : Deletes the unified_search_modules.php file in the cached module folder
  • Clear External API Cache Files : Deletes the external API cache PHP and JavaScript files in the cached include folder
  • Clear Additional Cache Files : Loops through the cached API folders and deletes any *.php files as well as the cached clients folder
  • Clear PDF Font Cache Files : Deletes the cached PDF font list file
  • Rebuild Extension Files : Rebuilds language files, extensions, dashlet containers, relationships, and the table dictionary; this step also clears any cached files by APC or WinCache, resets the Zend accelerator, clears eAccelerator's cache, and clears XCache cached files
    Note : These functions will only run if the associated systems are installed and running.
  • Rebuild Audit Tables : Creates audit tables for any module that has audit enabled and where the audit table does not already exist; the results for each table are printed on the page
  • Repair Database Tables : Checks to make sure the database is in synch with the table dictionary and vardef files; any missing tables, columns, and indexes will be scripted to be recreated as well as any column properties that are incorrectly set in the database. The screen will display any database changes that should be made. Click "Execute" to execute the script to apply the changes to the Sugar database or click "Export" to save the script to a SQL file.

Upgrade Teams

The Upgrade Teams option performs some cleanup regarding team records in Sugar. This can be useful to restore the private teams for all users in the event they become corrupted or are removed for any reason. The upgrade teams option performs the following actions:

  • Global Team : Creates or restores the global team if it does not exist or has been deleted. All users are then assigned to the global team if not already.
  • Private Teams : Creates a private team for every user in the system that does not already have a private team and assigns the user to their private team.

The results are printed on the screen as to what teams already existed and what teams were created.

Expand Column Width

The expand column width option provides a fix for some limitations of MSSQL when requiring multi-byte characters in the database. This limitation only exists for systems running on a MSSQL database while using the MSSQL Drivers for PHP. This function is not available and not necessary to be run on any of the currently supported database platforms.

Note: We recommend running Sugar on at least version 2.0.1 of the SQLSRV Drivers.

Use the following steps to run the Expand Column Width repair option:

  1. Select "Expand Column Width" from the Admin > Repair screen.
  2. Select from the dropdown which of the following actions you would like to take:
    Display SQL : Displays the appropriate sql commands on the screen.
    Export SQL : Creates a .sql file containing the appropriate SQL commands.
    Execute SQL : Executes the SQL commands on your database.
  3. Select "Go" to perform the selected action.
  4. The script takes any field in the database that is type varchar, char, or text and increases the length of the field. The new length is set to three times the current length, or if that is higher than 255, the length is set to 255.

Rebuild .htaccess File

Rebuild .htaccess File option creates or updates the .htaccess file in the root of the Sugar directory. The .htaccess file contains specific commands to prevent unauthorized access to certain files and directories on your webserver. File permissions need to be configured correctly in order for Sugar to write to the .htaccess file. If writing to the file fails, the expected contents for the file will be printed on the page.

Note: If you have additional lines to add to the .htaccess file, place them outside of the "# BEGIN SUGARCRM RESTRICTIONS" and "# END SUGARCRM RESTRICTIONS" lines or they will be removed when running this repair function.

Rebuild Config File

The Rebuild Config File option takes the config.php file in the root directory of Sugar and rebuilds it to have all default values for any options not specified directly. It first runs a check to make sure Sugar can write to the config.php file and will return to you if it can or not. When ready to rebuild the config file select "Rebuild".
The default values for the config will be merged with any custom values currently set and will be loaded into the config.php file.

Rebuild Sugar Logic Functions

The Rebuild Sugar Logic Functions rebuilds the cache files for all Sugar logic functions in the system. The Sugar logic functions are primarily used as formulas in field definitions. The results of the repair are shown on the screen.

Rebuild Relationships

Rebuild Relationships clears out the relationship cache and data and rebuilds it from the vardef files. Custom and stock relationships are all rebuilt. This repair option is good to run after an upgrade or when installing or uninstalling custom modules. The results of the repair are shown on the screen.

Rebuild Schedulers

The Rebuild Schedulers option removes all schedulers and recreates schedulers that come with Sugar by default. If you have customized the Active/Inactive flag, the frequency the job runs, or even deleted a job this repair option will restore all settings back to their original default value and recreate any deleted default schedulers.

Note: This also deletes any custom schedulers added to Sugar. If you have made changes to the default schedulers or created custom schedulers, please backup the details of each scheduler before running this repair.
The schedulers and their default settings are listed below:

Name Interval Range Status
Process Workflow Tasks As often as possible. 01/01/2005 05:30am - 12/31/2020 06:59pm Active
Run Report Generation Scheduled Tasks On the hour; 06:00am 01/01/2005 02:15am - 12/31/2020 06:59pm Inactive
Prune Tracker Tables On the hour; 02:00am; 1st 01/01/2005 12:00pm - 12/31/2020 06:59pm Active
Check Inbound Mailboxes As often as possible. 01/01/2005 02:00am - 12/31/2020 06:59pm Active
Run Nightly Process Bounced Campaign Emails On the hour; From 02:00am to 06:00am 01/01/2005 02:00pm - 12/31/2020 06:59pm Active
Run Nightly Mass Email Campaigns On the hour; From 02:00am to 06:00am 01/01/2005 08:15am - 12/31/2020 06:59pm Active
Prune Database on 1st of Month On the hour; 04:00am; 1st 01/01/2005 02:15am - 12/31/2020 06:59pm Inactive
Update tracker_sessions Table As often as possible. 01/01/2005 01:00am - 12/31/2020 06:59pm Active
Run Email Reminder Notifications As often as possible. 01/01/2008 08:30am - 12/31/2020 06:59pm Active
Clean Jobs Queue On the hour; 05:00am 01/01/2012 04:15am - 12/31/2030 06:59pm Active
Create Future TimePeriods On the hour; 11:00pm 01/01/2012 01:30am - 12/31/2030 06:59pm Active

Rebuild Sugar Dashlets

Rebuild Sugar Dashlets deletes the cached dashlets.php file and recreates it. This file contains the path to the php files, the class to use, and the module for each dashlet in Sugar. This repair option is good to run when making changes to the dashlets that come with Sugar or custom dashlet loaded into Sugar. The results of the repair are shown on the screen.

Rebuild WorkFlow

Rebuild Workflow deletes files in the custom workflows folder for each module and then rebuilds the files from the workflow data in the database. This repair also verifies the proper logic hooks are in place to properly fire the workflows and rebuilds any plug-ins that are installed.

Rebuild Javascript Languages

The Rebuild Javascript Languages function deletes all files in the cached jsLanguage folder and deletes any {Module Name}.lang.php file in the cached modules folder. The cached files will be rebuilt when they are needed.

Rebuild JS Grouping Files

Rebuild JS Grouping Files takes the many different JavaScript files that are required with Sugar and concatenates them together into the cache directory.

Note: The process will continue working if you navigate away from this page, but if you wait you will see a notification on the page when it is complete.

Rebuild Sprites

Rebuild Sprites takes images in the following directories:

  • ./include/images
  • ./themes
  • ./custom/themes

Creates the sprites and metadata files in the ./cache/sprites/ folder.

Note: The process will continue working if you navigate away from this page, but if you wait you will see a notification on the page when it is complete.

Repair Non-Lowercase Fields

The Repair Non-Lowercase Fields option takes any custom field defined in Sugar and, if the field contains an upper case letter, it will change the field to be lowercase. The database, vardef files, and views are all searched through and corrected for and uppercase fields. This option also clears any vardef files from the cache when finished.

Repair Teams

The Repair Teams option runs a quick check against the database for every user. It performs the following checks:

  • Users not in the global team
  • Users who do not have a private team
  • Users who are not a member of a team that a user who reports to them is a member of

If any of the checks return true, the page will indicate that records were found and the associated action will be selected by default. Select the options you wish to perform and click "Rebuild".

The selected options will perform the following:

  • Rebuild access to global team : Create a global team if one does not exist and loops through every user and adds them to the global team.
  • Rebuild access to private team : Loops through every user and creates a private team if one does not exist, and then adds the user to their private team.
  • Rebuild team hierarchy : Loops through every user and makes sure every manager is included in their employees' teams. This ensures that if Sally reports to Jim, that Jim can see all of Sally's records.
    Note : Sugar prevents a loop from being created via the Reports To field. For more information on setting the Reports To field, please refer to the User Management documentation.
  • Clean up unused combinations of teams : Searches the database for unused combinations of teams and deletes the records from the database.

The users looped through are displayed on the screen when complete.

Repair Roles

Repair Roles goes through every ACL enabled module and ensures that there are appropriate database records to allow roles to be used on the specified module. This repair is important to run after adding new modules via Module Loader or Module Builder to make sure all of the role options are available for the new module. If there is a module that has ACL enabled for it, but the module does not show in the Roles section, then this repair option will add the module. The results of the modules accessed are printed on the screen.

Repair Inbound Email Accounts

Repair Inbound Email Accounts loops through every active inbound email account in Sugar and verifies the settings configured. Any Inbound email account that fails to successfully repair will be listed on the page and will require someone to manually repair them by reentering a valid user name and password.

Remove XSS

The Remove XSS repair loops through the database and removes any malicious scripts from specified field types. Select a module from the dropdown, or select "All" to run for all modules.

The page will then display the count of records that will be scanned, and repaired if necessary. Click "Execute" to being the repair.
You will see the count of Object(s) Repaired incrementing as it is running. Once the repair is complete you will get a popup message saying "Done." and the count repaired should match the count of objects found.

Repair Activities

Repair Activities takes Call or Meeting records where the status field does not equal "Held" and updates the end date based on the duration of the activity. If the status equals "Held" or the record is marked as deleted, this repair will skip it. The screen will show "Done" when complete.

Enable/Disable Seed Users

The Enable/Disable Seed Users option will either enable or disable the default users that are installed with Sugar when selecting a demo installation. If the first seed user retrieved from the database is set to "Active" then this option will give you the option to "Deactivate" the seed users, otherwise, you have the option to "Activate" the seed users.
This option will set the status based on the option presented for all users that have an id that starts with "seed".

Note: If you did not populate Sugar with demo data when installing, this repair will return "No seed users" and will not do anything.

Clear Additional Cache

The Clear Additional Cache option loops through the cached API folders and deletes any *.php files as well as the cached clients folder. This option is also performed by the Quick Repair and Rebuild option. The screen will show "Done" when complete.


Last modified: 2021-07-07 21:37:47