Author Topic: Clean up large data before upgrade  (Read 3106 times)

potion

  • Freshman
  • *
  • Posts: 25
    • View Profile
    • WorkgroupBase
Clean up large data before upgrade
« on: May 24, 2013, 09:32:52 am »
I'm upgrading my last (and largest - that's why I've been procrastinating!) Feng Office instance from 1.7.5 to 2.x and want to cleanup the database tables and files before I do.

The biggest user of data is email, with the table fo_mail_datas, and the upload folder that contains all the attachment data.

Simply deleting old or irrelevant emails and their attachments does not clear the records in the database tables (I'm not sure what happens to the attachment in the upload tree).

Are there any tools or utilities that can help?

Denis
« Last Edit: May 24, 2013, 09:46:08 am by potion »

potion

  • Freshman
  • *
  • Posts: 25
    • View Profile
    • WorkgroupBase
Re: Clean up large data before upgrade
« Reply #1 on: May 27, 2013, 06:48:17 am »
I managed to clean up some redundant data with SQL:

First, from fo_searchable_objects:
Code: [Select]
DELETE so.*
FROM fo_searchable_objects so,  fo_mail_contents mc
WHERE so.rel_object_manager = "MailContents"
AND so.rel_object_id  = mc.id
AND mc.is_deleted = 1

Then, from both fo_mail_datas and fo_mail_contents:
Code: [Select]
DELETE md.*, mc.*
FROM fo_mail_datas md, fo_mail_contents mc
WHERE md.id = mc.id
AND mc.is_deleted = 1

...and then optimized the tables and reduced the size significantly.

I'm not yet sure if I broke anything, but there don't appear to be any ill effects.

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Clean up large data before upgrade
« Reply #2 on: May 28, 2013, 11:00:49 am »
I am not that sure whether that was a good move as you still have the fo_application_logs table.
I do not know how would these actions work out with this.

Best regards,
Francisco
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!