Mass move messages to another folder with SQL

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
mja
Posts: 8
Joined: Sun Dec 04, 2016 2:51 am

Mass move messages to another folder with SQL

Post by mja »

Hi,

I need to move around 300.000 messages from the Inbox folder to a subfolder. There are any problems moving it from Inbox folder directly using SQL? In this case I will update the folder_id of the mail_item table with the new folder_id, like the sql below.

Code: Select all

UPDATE mail_item SET folder_id = X WHERE mailbox_id=Y AND folder_id=Z and date BETWEEN b AND C
Will this SQL work? I need to update something else? There are anothers methods to mass move messages?

Thanks in advance,
Marlon
Post Reply