I am happy to let you know that I have now succesfully transferred the database from my Windows server to the Linux server.
For others who might want to do the same, I’ll summarize the steps taken. Note that these are (in part) specific for my situation, being one server running on Windows, one server running on Linux Ubuntu (24.04), and MariaDB on both servers. Furthermore, at this stage I only transferred the database, not Aware itself nor the Apache webserver.
- Prepare the Linux server and ensure that MariaDB is running.
- Ensure that MariaDB can be accessed from Aware on the Windows server: create the applicable rule in the firewall and add the Aware database account user in MariaDB (i.e. the user that is configured in the Database Settings in the Control Panel). It is not necessary to create a corresponding user on the Linux server itself.
- Make a snapshot of the Linux server and a backup of the database.
- Stop the Aware server.
- (Optional) Make a backup of the database on the Windows server.
- Copy databases from MariaDB on Windows to MariaDB on Linux.
I used dbForge Studio for this, it has a “Copy Databases” function that can copy multiple databases at the same time. Very convenient. An alternative may be to export the database to an SQL script which can then be used to import it to the Linux server, but at least with dbForge Studio I think this can only handle one database at a time so it is more work. Of course there are also other tools available. Make sure that all databases are copied, except for the MariaDB system tables.
- Create backup of BASServer.props file
- Start Aware Control Panel and change the database settings. If the same database account that existed on MariaDB on Windows was also created in MariaDB on the Linux server, then only the machine name has to be updated in the database settings. In my case I simply put in the IP address of the Linux server.
I had to take two additional steps to ensure that Aware could succesfully access the database on the Linux server:
Make MariaDB on Linux case insensitive:
Unix-based systems are case sensitive, Windows is not. This means that the default setting for MariaDB on Windows is that lower case table names are used, whereas the default on Linux is that MariaDB compares table names and database names in a case-sensitive manner. Apparently, Aware uses casing in the names of the databases and tables, so it could not find the databases because it was looking for the name in uppercase whereas it was copied with a lowercase name. This can be resolved by adding the setting lower_case_table_names=1 in a configuration file for MariaDB (I created an additional file 60-server-additions.cnf in /etc/mysql/mariadb.conf.d/ which has this setting and a few others. (see MariaDB Server Reference.
Reset the bas_idgen_seq sequences for all databases:
When the databases were copied, also the definition of the bas_idgen_seq sequence was copied, but this does not mean that the sequence number is set at the last number that it had on the Windows server. Thus, when adding new data the object ID will start again from 1. This can create problems because the object IDs need to be unique. I solved this by stopping Aware, check the current sequence number on the Windows server by running the SQL statements USE {database}; SELECT NEXT VALUE FOR bas_idgen_seq; and then running the statement USE {database}; SELECT SETVAL(bas_idgen_seq, {number}, FALSE); in MariaDB on Linux. In these statements ‘{database}’ must be replaced by the name of the relevant database and ‘{number}’ by the sequence number that is displayed after the first SELECT statement. This must be done for all databases used by Aware. The USE {database}; is added because you cannot prepend the database name to a sequence like for normal tables. (An alternative for SELECT SETVAL() is the statement ALTER SEQUENCE bas_idgen_seq RESTART {number}. This will lock the table of the sequence object so is theoretically safer to use, but I made sure that there was no other activity on the database).
- Restart Aware
Note that if Aware is started before MariaDB on Linux is set to use lower case table names, it can’t find the relevant databases and tables and automatically creates them with uppercase or camel case. This is mentioned in the Server Output in the Control Panel, but it’s also useful to check for any changes directly in the database. If this happens, shutdown Aware and manually delete those new databases. Ensure that MariaDB uses lower case table names (as described above) and restart MariaDB. Then (re)start Aware and check that it finds the existing databases/tables and does not create any new databases and tables.
After these steps, Aware is now happily running with the data from MariaDB on the Linux server. Everything seems to be working fine and the same as before the transfer. The only thing that doesn’t work anymore is the creation of a document from a MS Word template, but that was to be expected and is a separate issue unrelated to the database itself (documentation).