Answer
This article explains how to migrate the GFI MailEssentials reporting database from Microsoft Access / Firebird to Microsoft SQL.
IMPORTANT: This procedure is not applicable on a reporting database of GFI MailEssentials 2012 or earlier due to different database schema.
NOTE: The same procedure can also be applied to migrate to Microsoft SQL Express ( download: here ).
The procedure to import the reporting data from a Microsoft Access database into a Microsoft SQL database requires the following steps:
- Create a new database in Microsoft SQL server
- Import the reporting data from the Microsoft Access / Firebird database into the Microsoft SQL database
- Configure GFI MailEssentials to start using the new database
NOTE: In order to ensure that all new reporting data is stored in the new above mentioned Microsoft SQL database, please stop the following services before proceeding with the steps below:
- IIS Admin Service (, if platform is Microsoft IIS or Microsoft Exchange 2003)
- Microsoft Exchange Transport Service (, if platform is Microsoft Exchange 2007 or 2010)
- GFI MailEssentials Legacy Attendant Service (for GFI MailEssentials 2010 and older)
- GFI MailEssentials Antispam Attendant Service (GFI MailEssentials 2012)
Configure a new database in Microosft SQL server
You can create a new database from the Microsoft SQL Server Management Studio. This can be done by performing the following:
- Open the Microsoft SQL Server Management Studio
- Enter the server name and the credentials to connect to the Microsoft SQL Server and then click on Connect
- Right click on the Databases node and select New Database
- Enter the name of the database such as MailEssentials_Reports and click OK to create the database
NOTE: Should you be using Microsoft SQL Server Express, the Microsoft SQL Management Studio Express is not installed by default. You can download this separately at the following links:
Import the reporting data from the Microsoft Access database into the Microsoft SQL database
The procedure to import the Microsoft Access database to a Microsoft SQL Database differs depending if you are using Microsoft SQL Server or Microsoft SQL Server Express Edition. Use the appropriate procedure.
- Right click on the newly created database in Microsoft SQL Server Management Studio and select Tasks > Import Data
- Click Next button to proceed with the wizard
- In the Choose a Data Source dialogue box, select Microsoft Access as the Data Source type enter the path to the Microsoft Access file used as the current GFI MailEssentials Reporter database as seen in the screen shot below:
Click Next to proceed.
- Enter the appropriate information to access the SQL Database created above, as shown below:
Click Next to continue.
- Select the option Copy data from one or more tables or views and click Next to continue
- Select all the tables as follows:
Click Next to continue.
- Select to Run immediately and click Next to proceed
- Click on Finish to import all tables into the database
- The Import process will now run and complete as shown in the screen shot below:
- Click Close and the import process is completed
Microsoft SQL Server Express Edition
- Open the GFI MailEssentials reporting database you wish to export using Microsoft Access
NOTE: By default the reporting databases are stored in the following path <GFI\MailEssentials\Data>
- The Database tables are displayed once the mdb file is opened as seen in the screen shot below:
Microsoft Access 2003
Microsoft Access 2007
- Right click on the first table gfi_dle_db_verion and select Export
- Set the Save as type to ODBC Databases ()
- A dialogue box will appear to confirm the name of the Table. Do not make any changes to the name and click OK to continue
- In the Select Data Source Wizard, click New to create a new Data Source
- From the list, select SQL Native Client as the driver and click on Next to proceed
- Enter the name for the ODBC connection and click Next and then select Finish
- A new wizard will appear which will allow you to define the information for the SQL Server Express Instance.
- Enter the name of the SQL Server instance. For SQL Express this is normally <MACHINE_NAME\SQLEXPRESS>. Click on Next to continue.
- Enter the credentials required to connect and update the database table. It is recommended to us the SA account. Click Next to continue
- Check the Change the default database to: option and select the GFI MailEssentials Reporter Database created previously. Click Next to proceed
- Click on Next once again click on the Test Data Source button. You should receive TESTS COMPLETED SUCCESSFULLY! and then click OK
- In the Select Data Source window, select the Data Source you have just created and click on OK
- You might be prompted to enter the password for the SQL Server. Enter the appropriate password and click OK to export the data into the SQL Server
NOTE: This procedure needs to be done for every single table in the reporter database. You are able to use the same Database Source created previously when importing the remaining tables.
- Open the GFI MailEssentials Configuration
- Open the Reporting > Settings node
- Select the "SQL Server" option and specify the SQL Server settings
- Configure GFI MailEssentials to use the SQL Server and SQL database created above:
- Once GFI MailEssentials is properly configured with the new SQL database, start the following services once again:
- IIS Admin Service (If platform is Microsoft IIS or Microsoft Exchange 2003)
- Microsoft Exchange Transport Service (If platform is Microsoft Exchange 2007 or 2010)
- GFI MailEssentials AV Attendant Service
Configure GFI MailEssentials 2010 or older to start using the new database
- Open the GFI MailEssentials Configuration
- Expand Email Management and right click on the Reporting node and select Properties
- Click on the Configure button
- Configure GFI MailEssentials to use the SQL Server and SQL Database configured above:
- Once GFI MailEssentials is properly configured with the new SQL database, you can start the following services once again:
- IIS Admin Service (If platform is Microsoft IIS or Microsoft Exchange 2003)
- Microsoft Exchange Transport Service (If platform is Microsoft Exchange 2007 or 2010)
- GFI MailEssentials Legacy Attendant Service
NOTES:
- You are now able to view any previous data stored in the old reporting database.
- When using Microsoft Access as reporting database, GFI MailEssentials will automatically recreate a new database should the MDB file reach a size of 1.7GB. This is done to ensure the database does not get corrupt due to the size limitation for Microsoft Access Databases of 2GB. Should you wish to view information which is stored in old Microsoft Access databases, you are able to import this data into an SQL Server database.
- If you have a number of GFI MailEssentials Reporter databases, the procedure discussed above can be done to import all your data into one single SQL database.
- Once the procedure above is complete, GFI MailEssentials will start storing new data in the Microsoft SQL Server database configured.