Switching to Another Database Engine

This section describes how to make AggreGate Server use another database engine. By default, AggreGate Server uses an embedded database engine that's good for small installations (up to 20-30 devices). For larger installations it's recommended to use some production-grade database server, such as MySQL, Oracle, Microsoft SQL Server, PostgreSQL, Firebird, or other database management system.

Several versions of AggreGate Server contain a dedicated MySQL Database Server bundle inside the distribution package. If such a bundle was selected for installation, the server will be auto-configured to use enterprise-grade MySQL database. In this case, switching to another database engine is not necessary.

To switch AggreGate Server to another database engine, use the following procedure:

  • Make a backup of your AggreGate Server configuration file (server.xml in AggreGate Server installation folder). Put it into AggreGate Server installation folder and call it server_old.xml.
  • Install and configure your database engine if it was not yet installed.
  • Create a new database in your database engine. This database will be used by AggreGate Server to store its data.
  • Create a new user account in your database engine. This account will be used by AggreGate Server to access the database.
  • Grant the new user account permissions for the AggreGate Server database. It will require permissions to CREATE, ALTER and DROP tables, as well as INDEX them. Also, it must be able to INSERT, UPDATE, DELETE and SELECT data in all tables.
  • Shut down AggreGate Server if it's running.
  • Put your JDBC (Java Database Connectivity) database driver file into the /jar subfolder of AggreGate Server installation folder. This file usually has a .jar extension. For example, the JDBC driver for MySQL database engine is called MySQL-connector-java-X.X.XX-ga-bin.jar, where X.XX.XX is the driver version. The JDBC driver may be provided by the original maker of the database (Oracle etc), or by a third party.  
  • There is an alternative method of making your JDBC driver available to AggreGate Server:

    • Create a new server.vmoptions Launcher Properties File file in the AggreGate Server installation folder and open it for editing in a text editor.
    • Write -classpath/a <JDBC_Driver_File_Path> in the first and only line of this file. JDBC_Driver_File_Path is the full path of JDBC  database driver file (or name of this file, if it is located in the AggreGate Server installation directory).
  • Start Server Configurator utility, or start AggreGate Server and launch Configure Server action. Switch to Database tab in the server configuration dialog.
  • Change the Database Driver Global Configuration Setting setting to the name of Java class representing the database driver. This name is provided by the JDBC driver manufacturer. For example, MySQL database driver class is called “com.MySQL.jdbc.Driver”. More information on Global Configuration Settings may be found here.
  • Set the Database URL Global Configuration Setting to point to your database engine. Its format is also provided by the JDBC driver manufacturer. For MySQL it has the following format: jdbc:MySQL://[host][:port]/[database], where [host] is the IP or hostname of the MySQL server (can also be an empty string or localhost), [port] is the port number on which the MySQL server is running (optional - the default port is used if it's not specified), and [database], which is the name the of database containing AggreGate Server data. You can use “AggreGate Server” for the database name. For example, if your MySQL server runs on 192.168.0.1, on the default port, use the following URL: jdbc:MySQL://192.168.0.1/AggreGate Server.
  • Specify the correct Database Username and Database Password Global Configuration Settings. These credentials are used to access the database specified by the Database URL setting.
  • Set the Database Dialect Global Configuration Setting to the predefined value corresponding to the type of your database. See Database Dialect global configuration setting for more info.
  • Save the new settings. Do not restart the server, even if you're prompted to do that.
  • Stop the server configurator (or AggreGate Server).
  • Run database converter utility that is located in AggreGate Server installation folder to move data from the old database to the new one.
  • Wait for the converter to finish work. Depending on the database size, it may take from several seconds to several hours.
  • Start the AggreGate Server.
  • Voila! All done, you're now using the new database.
  • The maximum number of parallel connections allowed by your database server must be greater than the value of Maximum Connection Pool Size global property of AggreGate Server. In most cases, the default number of parallel connections allowed by the database server is lower and should be adjusted. Refer to your database server documentation to find out how to increase this limit.

    Was this page helpful?