Answer
This is a legacy article. It is not maintained anymore and might contain outdated information.
Please refer to this article instead: Script: RemoveEmptyFolderStructure (INTERNAL ONLY)
Microsoft SQL Server 2005 / 2008 / 2008R2 / 2012
GFI MailArchiver Firebird database
Please refer to this article instead: Script: RemoveEmptyFolderStructure (INTERNAL ONLY)
The following procedure explains how to remove the existing folder structure from the Archive Stores and reassociate the emails to either the Inbox or the Sent Items folder. The procedure differs if you are using Microsoft SQL or the GFI MailArchiver Firebird database as a database backend. Follow the appropriate procedure described below:
IMPORTANT
- This script should be applied ONLY to installations of the following builds of GFI MailArchiver 2013: 20130510, 20130704, 20130723, 20131111
- Please ensure to read the readme.txt bundled with the script
- It is recommended to take a backup of your GFI MailArchiver databases before applying the scripts below
PROCEDURE
- Download the script: http://ftp.gfisoftware.com/support/MARC/ScriptsAndTools/2013/MARC2013_REMOVE_FOLDER_STRUCTURE_SCRIPT_20140130_01.zip
- Extract the download zip file
- It contains 4 individual scripts to be used dependent on the situation:
- Microsoft SQL\MSSQL_MARC2013_remove_folder_structure.sql
- Microsoft SQL\MSSQL_MARC2013_remove_folder_structure_for_user.sql
- FireBird\FB_MARC2013_remove_folder_structure.sql
- FireBird\FB_MARC2013_remove_folder_structure_for_user.sql
Microsoft SQL Server 2005 / 2008 / 2008R2 / 2012
MSSQL_MARC2013_remove_folder_structure.sql
Clears the folder structure except for Calendar folders. Each email is then associated to either the user's Inbox or Sent folder.
MSSQL_MARC2013_remove_folder_structure_for_user.sql
Clears the folder structure for a specific user. Each email is then associated to either the user's Inbox or Sent folder. Look for 'TODO:' tag in script to enter username.
- Load the 'Management Studio'
- Register and connect to your instance of SQL Server with 'sa' account
- Select File -> Open and browse for the script file
- Select the archive store's database on which to apply the script
- Modify the folder name in the TODO part of the script
- Press F5 to execute query
GFI MailArchiver Firebird database
'FB_MARC2013_remove_folder_structure.sql'
Clears the folder structure except for Calendar folders. Each email is then associated to either the user's Inbox or Sent folder.
'FB_MARC2013_remove_folder_structure_for_user.sql';
Clears the folder structure for a specific user. Each email is then associated to either the user's Inbox or Sent folder. Look for 'TODO:' tag in script to enter username.
Note: None of the scripts will remove the Inbox/Sent folders:
- Stop the GFI MailArchiver Store Service service
- Make sure that you take a backup of the Firebird database located under the GFI MailArchiver\Databases folder
- Load IBExpert
- Register and Connect to the Firebird Database
- Tools -> SQL Executive
- Load '[FB_MARC2013_remove_folder_structure.sql]' or ['FB_MARC2013_remove_folder_structure_for_user.sql']
- Enable 'Use current connect' check box
- Modify the foldername in the TODO part of the script
- Execute Script (Press Green Play Button)
- Close IBExpert
- Start the GFI MailArchiver Store Service service