The accounts and domains settings are by default
stored in the binary files in Merak\config folder, but you can
configure Merak to store that in a database also. You can store also
logs in a database, but it's not recommended.
You can find the groupware database connection
settings in the Administration interface/Groupware/General/”DB
Settings...” dialog, the anti-spam database connection settings
can be found in the Anti-Spam/General/General/”DB Settings...”
dialog and the account database settings can be set in the
System/Storage/Accounts/”DB Settings...” dialog (after
you enable database account storage).
Supported databases
The Merak 9 (Windows) installer lets you choose
whether you plan to use Merak as small or large server - the basic
installation for < 100 accounts and advanced installation for
100+
accounts. This question is asked because of database storage. There
are basically 2 types of databases - file databases and database
servers. The file databases are suitable only for smaller servers -
they don't need any additional programs to be installed, but they
don't handle big loads well. The database servers need to be
installed and configured, however they are able to handle the more
traffic. The account database storage is recommended for Merak with
more than 500 accounts, the dedicated SQL server is recommended for
Merak with more than few thousand accounts.
The default database for basic Windows Merak 9 installation is
SQLite
database, in versions prior to Merak 9 the default
database was MS Access database.
The MySQL database for versions 9.1 and older was
needed for Linux Merak installation, in newer versions the default
database will be also SQLite.
Generally Merak supports syntax of these database servers and
database engines: MS SQL, MySQL,
InterBase, Oracle and Firebird,
MS Access and SQLite. The syntax
is important because of difference between the string variable type of
each SQL server. The "Default" syntax is universal syntax, but it
doesn't use full potencial of the specific servers, so it's better to
specify the correct server syntax.
Database server
settings and connection settings
-
ODBC (Open DataBase Connectivity)
- the ODBC DSN (Database Source Name) is needed to connect to MS Access
database, MS SQL, InterBase and Oracle servers. The MySQL and FireBird
database can use either it's own drivers or ODBC.
For more info please see these FAQs about ODBC:
- How
to set ODBC DSN for MS Access database
- How
to set Merak to use ODBC with MS SQL server
- How
to set Merak to use ODBC with MySQL
-
SQLite - the SQLite
database doesn't need the ODBC DSN or any additional driver
installation. The database files are installed with Merak 9+ regardless
the currently selected database settings (the along with SQLite driver).
The groupware database is located in the
Merak\calendar\groupware.db file. The Groupware/General/”DB
Settings...” for this configuration are:

The anti-spam database is located in the
Merak\spam\antispam.db file. The Anti-Spam/General/General/”DB
Settings...” for this configuration are:

-
MySQL - you don't
have to use ODBC to connect to MySQL server from Windows version of
Merak, you can connect directly to the MySQL server using the driver
from your version of MySQL server. You can find it in the MySQL server
installation folder:
MySQL server <version>\bin\libmysql.dll
You should either add this path to Windows system path or copy this
file to Windows\system32\ to be able to connect to MySQL server without
ODBC.
Note: The libmysql.dll library was part of the
installation in versions prior to Icewarp server 9.1. It is strongly
recommanded to delete Merak\libmysql.dll file and use the library of
your current MySQL server instead.
MySQL database is needed for Linux installation of Merak
9.1 or older (in case you want to use Groupware and Anti-Spam features
mentioned above). Required libraries are in most cases installed along
with Linux.
Here is the example how you can create database for Merak:

The ”DB Settings...” on Windows for both groupware and
anti-spam are for the local server with example database from above:
The typical “DB Setting...” for the same database on Linux:
Database Migration
Merak contains integrated database migration tool. You can use
it
to migrate from one type of database to another (to the same type
too, of course), as well as to backup your database. The database
migration is located in the Administration interface
System/Tools/Database Migration section.
You should select the database type (whether you migrate
account,
groupware or anti-spam database) and fill the DB connection settings
according to instructions in previous chapter.
Database migration process drops destination database tables
(not
all, only those, which belong to selected database type, and only if
the tables exist, naturally), and creates new tables with the same
data as in the source database.
Troubleshooting
All database errors are recorded into Merak error log
(you can find it in the Administration interface Status/Log/Error
log). So if you experience any problems with the database check the
log first.
As mentioned above, the file based databases are not
suitable for larger servers (100+ accounts), so these servers should
migrate database the some SQL server – this may resolve many
problems.
Jan Ramba, jan (at) icewarp (dot) com