Let the platform do the work

Manually Removing Module Loader Packages

Overview

While uninstalling a package (e.g., Sugar Connector for Marketo) in Module Loader, you notice older versions of the same package display as installed. You can uninstall these packages from Sugar, but may experience issues where the Uninstall button does not appear next to the package or the uninstall process fails to complete. This article will cover how to manually remove module loader packages from Sugar.    

Note: This article applies only to instances that are hosted on-site. 

Symptoms

You may experience one of the following issues while attempting to uninstall the older package in Module Loader:

  • The Uninstall button does not appear next to the package name in Module Loader.
    image1
  • Performing the uninstall for the package results in an error.
    image2

Note: These issues typically indicate that a newer version of the Module Loader package with the same file name was installed, then uninstalled, and Sugar is unable to properly complete the uninstall process for the older version of the package.

Resolution

To resolve this issue, references to the previously uploaded package, as well as the entry in the database will need to be removed.

Moving Files to "disabled" Directory

Please use the following steps to remove the reference to the package in the Sugar file system:

  1. Navigate to the following directory:
    1. For Sugar versions 10.0.x and lower: ./upload/upgrades/module/
    2. For Sugar versions 11.0.x and higher: ./upgrades/module/
  2. Create a new directory titled "disabled".
  3. Move the files that are related to the specific package into the newly created "disabled" directory.
    • For our example, the following files would be moved into the "disabled" directory:
      • debug_marketo-manifest.php
      • debug_marketo.zip

Additionally, you will need to ensure the module is fully disabled in your instance.

  1. Navigate to the ./custom/Extension/application/Ext/Include/ directory.
  2. Create a new directory titled "Disabled" if one does not already exist.
  3. Open any files in the Include directory and if the file references the module you are attempting to remove, transfer the file to the Disabled directory.
  4. In Sugar, go to Admin > Repair > Quick Repair and Rebuild to rebuild the Extension directory with the changes you made.

Note: There may be additional files that remain as part of the module once the module is disabled. If this the case, rerunning the health check should identify any additional critical files that will need to be disabled.

Removing Records From "upgrade_history" Table

Once the appropriate files are moved to the "disabled" directory, the database reference will need to be removed.

Please use the following steps to remove the database reference:

  1. Use the following query to select the records in the upgrade_history table that match the name of the package:
    • SELECT * FROM upgrade_history WHERE filename LIKE '%/%';
    • For our example, the query would be: SELECT * FROM upgrade_history WHERE filename LIKE '%/debug_marketo.zip%';
  2.  Delete the returned records from the upgrade_history table.

Navigate back to Module Loader to confirm that the packages no longer appear.