PMSE tables cleaning in database

Dear developpers,

I would like to make a cleaning for the executed BPM processes, is it enough to remove data from the table PMSE_INBOX or is there other table to cleanup ?

Additionnaly, I would do the same for the emails, I want to keep only one year of data, I identified the following tables : 

  • emails
  • emails_beans
  • emails_email_addr_rel
  • emails_text

What do you propose ? Did you face the same issue ? What is the best practice to make a safe cleanup / archiving ?

Thanks in advance,

Enes

  • Hello Junaid,

    Thanks for the trick, I'll check that if the toothpast command won't work for Oracle Slight smile

    Best regards,

    Enes

  • Hi Enes,

    You are welcome Slight smile

    I have another question related to SugarBPM as you are already using the Oracle database. Did you guys face the issue that records stop showing up in the process management view once the 'Process Number' reached 9999? Also in the logs start getting the following error message.

    "ORA-01438: value larger than specified precision allowed for (CAS_ID) this column"

    Kind Regards,

    Junaid

  • Hi Junaid,

    Currently we have more than 560.000 records in pmse_inbox table, and no problem related to the one you mentionned Slight smile

    We are running in Oracle 12c.

    Best regards and have a nice friday !

    Enes

  • Hi Enes,

    Yes, the cas_id field in the pmse_inbox table is all good. The problem comes in the related tables like pmse_bpm_thread, pmse_bpm_flow as they can only store up to 4 digit values in the mentioned field.

    We are also using Oracle 12c, so it's strange you didn't notice that problem yet. Anyway, I am in contact with Sugar support on this, and let's see what they have to say.

    Kind Regards and have a nice weekend ahead.

    Junid

  • Hello Junaid,

    I just checked in my database, and the cas_id column in pmse_bpm_flow table is not limited to 4 digits, no problem at all. Very strange :/

    By the way, how are the general performance for your instance ? We are running in Sugar 7.9.3 (migration planned next year) and it is very slow when saving or displaying cases for example (700.000+ cases).

    Best regards and have a nice week.

    Enes

  • ,

    Sugar had a huge amount of performance improvements since version 7.9 (2017 release).

    Please note that 7.9 has not been supported for a number of years as well, as the current on-premise version is 10.0.x.

    The recommendation from me is to start planning the upgrade, as there are many steps involved (both on the infrastructure/architecture and at the application level) on getting through 3+ years worth of releases.

    For your specific scenario you will find especially useful for listviews speed up some features we released back in version 8 to optimise record listing retrieval.

    In saying that, it is good to think about either an archival strategy or a performance testing combined with system scaling strategy to make sure your system is in optimal shape for your business needs.

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

  • Hi Enes,

    Then looks like they introduced that in Sugar9 or 8 because sugar support considers it as a bug.

    Regarding performance issues, I would highly recommend upgrading your instance to Sugar9. As Enrico already mentioned, since Sugar8 there are a lot of performance improvements and things are loading pretty fast as compare to Sugar7.

    Kind Regards,

    Junaid

  • Hello again ,

    I installed in our dev environment, but I have the following error while running any command : 

    [28-Jan-2021 10:30:37 Europe/Luxembourg] PHP Fatal error:  Uncaught Error: Call to a member function retrieveSettings() on null in /var/www/html/sfa3-uat/sfa-sugar/modules/Administration/Administration.php:368
    Stack trace:
    #0 /var/www/html/sfa3-uat/sfa-sugar/include/entryPoint.php(199): Administration::getSettings()
    #1 /var/www/html/sfa3-uat/toothpaste/vendor/esimonetti/toothpaste/src/Sugar/Instance.php(78): require_once('/var/www/html/s...')
    #2 /var/www/html/sfa3-uat/toothpaste/vendor/esimonetti/toothpaste/src/Commands/CustomTableOrphansCleanupCommand.php(47): Toothpaste\Sugar\Instance::setup()
    #3 /var/www/html/sfa3-uat/toothpaste/vendor/symfony/console/Command/Command.php(255): Toothpaste\Commands\CustomTableOrphansCleanupCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #4 /var/www/html/sfa3-uat/toothpaste/vendor/symfony/console/Application.php(935): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\Conso in /var/www/html/sfa3-uat/sfa-sugar/modules/Administration/Administration.php on line 368
    [28-Jan-2021 10:30:37 Europe/Luxembourg] PHP Fatal error:  Uncaught Error: Call to a member function retrieveSettings() on null in /var/www/html/sfa3-uat/sfa-sugar/modules/Administration/Administration.php:368
    Stack trace:
    #0 /var/www/html/sfa3-uat/sfa-sugar/modules/Trackers/TrackerManager.php(42): Administration::getSettings('tracker')
    #1 /var/www/html/sfa3-uat/sfa-sugar/modules/Trackers/TrackerManager.php(78): TrackerManager->setup(false)
    #2 /var/www/html/sfa3-uat/sfa-sugar/include/utils.php(3181): TrackerManager::getInstance()
    #3 [internal function]: sugar_cleanup()
    #4 {main}
      thrown in /var/www/html/sfa3-uat/sfa-sugar/modules/Administration/Administration.php on line 368
    

    Here is the call I'm doing : 

    ./toothpaste/vendor/bin/toothpaste local:data:clean:custom-orphans --yes-hard-delete-live-data --instance=/var/www/html/sfa3-uat/sfa-sugar/

    Do you have an idea on what is wrong ? 

    I'm facing the error even if I run it with root user or apache user.

    Best regards,

    Enes

  • That's odd. Were you able to get it to work previously? What was different then? Different Sugar version? Different php version?

    Could you give more details about the Sugar version? Could you try with the latest you have at hand?

    My educated guess would be that perhaps it is an older Sugar version, which this tool was built after?

    Either way, please let me know how I can help, as I would like to fix it if something is not working.

    Cheers!

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

  • Hello Enrico,

    Not on this instance in fact, on others yes (on prem as well as sugardockerized).

    We are still in SugarCRM v7.9.3.0, we plan to migrate in a few months. Could it be the reason ?

    Thanks a lot for your feedback.

    Best regards and have a nice week !

    Enes