Announcement

Collapse
No announcement yet.

Clean Up Database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Clean Up Database

    Hi there,

    it's about crons / jobs and database

    1.)
    I noticed that the automatic job "Clean-up" runs suddenly with errors. See Figure 2. What can I do to make the cron work properly again?

    2.) In the Espo database I found the tables from picture 1:
    - note
    - note_User
    - note_team
    - notifications

    In my opinion, it is unimportant log data. The tables are really big now! So my question is: can I safely empty these tables?

  • #2
    Hi animax ,

    for the question number 1, needs to look at the log files to check the error messages, unless anyone cannot help.

    for the question number 2, the short answer is YES you can empty them with no effect to the whole crm, BUT keep in mind that you will lose the data included in these tables,

    It is good for you to know what every table refers to:

    - note: holds the users posts in streams & all entities action made like created action and updated audited fields
    this is a bit important data in some cases if users relied on it usually

    - note_User: holds data for who user can see which note

    - note_team: the same for teams

    - notifications: I think this is not very important and can be empty.

    I prefer to archive these tables before you empty, and for notes I prefer make conditionally clean so you remain for the posts for example and you may only remove the notes before 2020.
    CEO & Founder of Eblasoft.
    Professional EspoCRM development & extensions.

    Comment


    • #3
      This SQL statement can be used for the conditionally remove records from note table:

      PHP Code:
      DELETE     FROM `note`
       
      WHERE     `type` <> 'Post'  AND created_at '2020-01-01' 
      Last edited by eymen-elkum; 03-26-2020, 08:54 AM.
      CEO & Founder of Eblasoft.
      Professional EspoCRM development & extensions.

      Comment


      • #4
        Hi ayman.alkom, thank you for your good support!

        Comment


        • #5
          Is there any Command to delete a record through workflow? For Example if an Opportunity the Status is Closed Lost and Close Date is Past, I want the Opportunity to be deleted after 30 Days

          Comment


          • #6
            > Is there any Command to delete a record through workflow

            Yes. By using Update Target Record action > formula:

            Code:
            deleted = true;

            Comment

            Working...
            X