Archiving e-mails: Difference between revisions

From support-works
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Emails should be archived periodically in order to avoid performance issues caused by a large number of emails in the database.
__NOTOC__
{{Template:Basic Cover
|title=Archiving e-mails
|type=FAQ
|htl=Y
}}


In order to archive emails, the Administrator can move them (to subfolders) via MySQL. However before proceeding, please ensure that a full server backup is taken.
{{Template:Basic Status
|status=Published
|version=1.0
|authors=HTL
|applicableto=Supportworks ESP
}}


Solution:
Emails should be archived periodically in order to avoid performance issues caused by attempting retrieve a large number of emails via the client each time a folder / sub-folder is accessed. The following method Archives emails by moving the mail to folders / sub-folders within the Mailbox folder structure.  It should be noted that the maximum recommended number of emails in each folder/sub-folder should not exceed 4000.
Below is the procedure for archiving:


Administrators can create folders and sub-folders and subsequently move mail messages to them via MySQL.  However before proceeding, it is recommended that a full server backup is taken.


Use Sw_Messagestore;
The following describes the necessary steps for the procedure (replace ‘MAILBOX’ with the name of the Shared Mailbox):
Select * from Shared__MBName_folders;


A list of folders and IDs will now be shown. Make a note of the results.
<code>Use Sw_Messagestore;<br/>
Select * from Shared__MAILBOX_folders;</code>


A list of folders and IDs will now be shown, make a note of the results.


Moving Emails to Subfolders:
Moving Emails to Subfolders:


Emails can be moved to subfolders, as it is recommended that the number of emails in each folder/subfolder should not exceed 5000. This can be done using the following SQL query (replace ‘MAILBOX’ with the name of the Shared Mailbox, ‘folderparent’ with the FolderID of the main folder in which the sub folder will be created –if any and ‘folderName’ with an appropriate value):
You will be required to create the new folders / subfolders (replace ‘MAILBOX’ with the name of the Shared Mailbox, ‘folderparent’ with the FolderID of the main folder in which the sub folder will be created (if root set to 0) and ‘folderName’ with the appropriate value):


Insert into Shared__MAILBOX_folders (folderparent, foldername, folderhaschild, folderunreadcount) values ( FolderParent, 'FolderName', 0,0 );
<code>Insert into Shared__MAILBOX_folders (folderparent, foldername, folderhaschild, folderunreadcount) values ( FolderParent, 'FolderName', 0,0 );</code>


Once done, the administrator needs to obtain the FolderID for the newly created folder by running the following query:  
Once completed, FolderID for the newly created folder can be obtained by running the following query:  


Select folderid from shared__MAILBOX_folders where foldername = 'FolderName';
<code>Select folderid from shared__MAILBOX_folders where foldername = 'FolderName';</code>


This will return an integer value. Use this integer in the following statement in place of FOLDERID and replace ORIGFolder with the Value for the existing folder from which items are being moved:
This will return an integer value. Use this integer in the following statement in place of FOLDERID and replace ORIGFolder with the Value for the existing folder from which items are being moved:


Update shared__MAILBOX_mailbox set MsgFolder = FOLDERID where msgfolder = OrigFolder limit 5000;
<code>Update shared__MAILBOX_mailbox set MsgFolder = FOLDERID where msgfolder = OrigFolder limit 4000;</code>


This will move 5000 items to the new folder. This can be repeated as required.
This will move 4000 items to the new folder. This can be repeated as required.


Once done the required emails should have been moved from within the client.
Once completed the emails will now be visible within the new folders from within the client.

Latest revision as of 15:33, 20 August 2015




Status: Published
Version: 1.0
Authors: HTL
Applies to: Supportworks ESP

Emails should be archived periodically in order to avoid performance issues caused by attempting retrieve a large number of emails via the client each time a folder / sub-folder is accessed. The following method Archives emails by moving the mail to folders / sub-folders within the Mailbox folder structure. It should be noted that the maximum recommended number of emails in each folder/sub-folder should not exceed 4000.

Administrators can create folders and sub-folders and subsequently move mail messages to them via MySQL. However before proceeding, it is recommended that a full server backup is taken.

The following describes the necessary steps for the procedure (replace ‘MAILBOX’ with the name of the Shared Mailbox):

Use Sw_Messagestore;
Select * from Shared__MAILBOX_folders;

A list of folders and IDs will now be shown, make a note of the results.

Moving Emails to Subfolders:

You will be required to create the new folders / subfolders (replace ‘MAILBOX’ with the name of the Shared Mailbox, ‘folderparent’ with the FolderID of the main folder in which the sub folder will be created (if root set to 0) and ‘folderName’ with the appropriate value):

Insert into Shared__MAILBOX_folders (folderparent, foldername, folderhaschild, folderunreadcount) values ( FolderParent, 'FolderName', 0,0 );

Once completed, FolderID for the newly created folder can be obtained by running the following query:

Select folderid from shared__MAILBOX_folders where foldername = 'FolderName';

This will return an integer value. Use this integer in the following statement in place of FOLDERID and replace ORIGFolder with the Value for the existing folder from which items are being moved:

Update shared__MAILBOX_mailbox set MsgFolder = FOLDERID where msgfolder = OrigFolder limit 4000;

This will move 4000 items to the new folder. This can be repeated as required.

Once completed the emails will now be visible within the new folders from within the client.