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)
The following procedure explains how to delete particular or all empty synchronized folders found in the GFI MailArchiver web interface. 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:
Please refer to this article instead: Script: RemoveEmptyFolderStructure (INTERNAL ONLY)
The following procedure explains how to delete particular or all empty synchronized folders found in the GFI MailArchiver web interface. 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
- Download the script: http://ftp.gfisoftware.com/support/MARC/ScriptsAndTools/2013/MARC2013_REMOVE_EMPTY_FOLDERS_SCRIPT_20140303_01.zip
- Extract the download zip file
- It contains 4 individual scripts to be used dependent on the situation:
- \Microsoft SQL\Remove All Empty Folders\MSSQL_MARC2013_Remove_All_Empty_Folders.sql
- \Microsoft SQL\Remove Empty Folder\MSSQL_MARC2013_Remove_Empty_Folder.sql
- \FireBird\Remove All Empty Folders\FB_MARC2013_Remove_All_Empty_Folders.sql
- \FireBird\Remove Empty Folder\FB_MARC2013_delete_empty_folder.sql
Microsoft SQL Server 2005 / 2008 / 2008R2 / 2012
- Stop the GFI MailArchiver Store Service
- Open Microsoft SQL Server Management Studio
- Register and connect to your instance of SQL Server with the sa account
- Determine which script you need to use. If you wish to delete all empty folders, use the script 'MSSQL_MARC2013_Remove_All_Empty_Folders.sql'. Should you only wish to delete one empty folder, perform the following procedure:
- Open the 'MSSQL_MARC2013_Remove_Empty_Folder.sql' using Notepad or any text editor
- Locate the 'SET @FolderName =' line, and replace 'Inbox|Sales|2009Q3' with the foldername you wish to delete
- Example: 'SET @FolderName = 'Inbox|Sales'
- Save your changes to the script file
- Within the SQL Management Studio, select File > Open and browse for the script file selected in step (4)
- Select the archive store's database on which to apply the script
- Press F5 to execute query
- Start the GFI MailArchiver Store Service
GFI MailArchiver Firebird database
- Stop the GFI MailArchiver Store Service
- Download IBExpert from http://www.ibexpert.net/ (Personal or Trial edition)
- Install IBExpert
- Open IBExpert and click on 'Database' > 'Register Database' to open the 'Database Registration' dialog
- Enter the following details in the 'Database Registration' dialog and click 'OK':
- Server = Local
- Server Version = Firebird 2.0
- Database File = <Navigate to your MailArchiver database FDB file>
- User Name = SYSDBA
- Password = masterkey
- Client Library File = ..\Program Files\HK-Software\IBExpert\gds32.dll
- Double click the FDB database name to open the connection to the firebird database
- Click Tools > SQL Executive
- Determine which script you need to use. If you wish to delete all empty folders, load the 'FB_MARC2013_Remove_All_Empty_Folders.sql'. Should you only wish to delete one empty folder, perform the following procedure:
- Open the '\FireBird\Remove Empty Folder\FB_MARC2013_Remove_Empty_Folder.sql' using Notepad or any text editor
- Locate the 'FolderName =' line, and replace 'Inbox|Sales|2009Q3' with the foldername you wish to delete.
Example: FolderName = 'Inbox|Sales' - Save your changes to the script file.
- Load the appropriate SQL file selected in step (8)
- Execute the Script (Press Green Play Button)
- Close IBExpert
- Start the GFI MailArchiver Store Service