Skip to main content

Upgrade Guide

This page documents the required upgrade path for Artemis, what the database migration does on startup, and how to verify that it worked.

How the Schema Is Applied​

Artemis keeps its schema in Liquibase changelogs, organised into four directories that every startup reads in order:

DirectoryContents
baseline/The whole schema as of the last consolidation, in a single file
history/Every changelog that baseline already contains, grouped by generation (v10/, v11/, …)
changelog/Migrations written since the last consolidation
data/Seed data for test environments

Which of these actually execute depends on the database Artemis finds:

  • An empty database applies the baseline, which creates the schema in one step. The changelogs under history/ are recorded as applied without being executed, because the baseline already contains everything they describe. Anything under changelog/ then runs normally.
  • An existing database already has the changelogs under history/ recorded from when it ran them, so Liquibase skips them. The baseline marks itself as applied without executing, because the schema it would create is already there. Only the changelogs under changelog/ run.

Both routes end with the same schema, so it makes no difference to the running instance whether it was installed fresh or upgraded over several years. A check on every Artemis pull request applies both routes to an empty database and compares the results on MySQL and PostgreSQL.

Planned Removals in Artemis 11​

  • Jenkins. The replacement is LocalCI, which runs build jobs in Docker containers on build agents that you scale by adding nodes. LocalVC remains the version control system. Follow the Jenkins to LocalCI migration guide. An installation is affected if the jenkins profile is active. See Integrated Code Lifecycle setup for the target setup. The Jenkins-only settings (jenkins.*, the artemis.continuous-integration keys that are marked as Jenkins specific, and the shared build agent git credentials) are removed with it.
  • MySQL. The replacement is PostgreSQL. An installation is affected if its JDBC URL starts with jdbc:mysql. Production installations that still use MySQL already have to override spring.jpa.database: MYSQL, because PostgreSQL is the default. The MySQL branches of the Liquibase baseline and the MySQL test and CI jobs are removed in Artemis 11, which does not support MySQL. Migrate the data to PostgreSQL while you still run a 10.x release, with the guide Migrating MySQL Data to PostgreSQL.

The roadmap lists the whole scope.

Memiris Storage Cleanup After 10.4​

Artemis 10.4 removed the Memiris integration. The later contract migration 20261022231936-01-remove-memiris-storage drops user_ai_preference.memiris_enabled, iris_message.accessed_memories and iris_message.created_memories. It also removes AI preference rows without a selection decision, and 20261022231936-02-require-ai-selection-decision makes user_ai_preference.selection_decision mandatory, so such rows cannot appear again. Recorded decisions, including NO_AI, their timestamps, user accounts and chat messages remain.

Deploy this cleanup only in a release after 10.4. Reverting the WAR to 10.4, which no longer maps these columns, remains compatible with the cleaned schema. Older releases that still read or write them require the database backup taken immediately before the migration. The migration permanently deletes the legacy memory data and deliberately refuses a Liquibase rollback rather than recreating empty columns and presenting them as recovered data.

The distributed-data schema version is unchanged. The retired Feature.Memiris enum constant remains in its original position because removing it would change the persisted Redis keys of every feature after it, even if Memiris was never enabled. Its eventual removal belongs with an explicit distributed-data migration; see Changing a stored type.

This migration affects only the Artemis database. Deployments that used Memiris must separately remove its unused Weaviate collections (Memory, Learning and MemoryConnection) after deploying Pyris without Memiris.

Why Intermediate Versions Are Required​

Consolidation adds a baseline alongside the changelogs it summarises; it never rewrites them. An upgrade therefore needs no intermediate version on account of consolidation alone.

An intermediate version is required when the chain of changelogs leading to your database's state is no longer complete in the release you are installing. Two things cause that:

  • Releases up to 9.x reused changeset identifiers. Each consolidation replaced the contents of the initial schema file while keeping the same changeset identifiers, so a database that recorded the previous major version's initial schema no longer matched the file. Upgrading repaired this on the way past, but only from the one version it was written for. This is why upgrading to 10.0.0 still requires passing through 9.9.3.
  • A retired generation. When upgrades from a generation are no longer supported, its directory under history/ is removed. A database that never ran those changelogs can then no longer be brought forward, and the release notes name the version to pass through.

From 10.0.0 onwards each baseline has its own file and its own changeset identifiers, so identifiers never collide again. A new required version appears only when a generation is retired, which is an explicit decision announced in the release notes rather than an automatic consequence of every major release.

Upgrade Path Table​

The table below shows the required intermediate version for each major release. You must deploy and start the Required Version at least once before upgrading to the Target Version.

Target VersionRequired Intermediate VersionValid Until
6.0.05.12.97.0.0
7.0.06.9.68.0.0
8.0.07.10.59.0.0
9.0.08.8.610.0.0
10.0.09.9.311.0.0

How to Read This Table​

  • Target Version: The major version you want to upgrade to.
  • Required Intermediate Version: The minimum version your database must have been running before upgrading to the target version. Deploy this version, start Artemis, wait for it to fully initialize, then upgrade to the target version.
  • Valid Until: The migration path is removed at this version. For example, the 5.12.9 → 6.0.0 path is available until 7.0.0, after which upgrading from 5.x is no longer supported.

Upgrade Scenarios​

Fresh Installation​

A fresh installation (empty database) can always use the latest version directly. No intermediate versions are needed.

Upgrading Within a Major Version (e.g., 8.5.0 → 8.8.6)​

Minor and patch version upgrades within the same major version require no special steps. Simply deploy the new version. All incremental Liquibase changelogs will be applied automatically.

Upgrading Across One Major Version (e.g., 9.9.3 → 10.0.0)​

  1. Deploy and start the required intermediate version (e.g., 9.9.3) to ensure all incremental migrations are applied.
  2. Wait for Artemis to fully start (check logs for "Started ArtemisApp").
  3. Stop Artemis.
  4. Take a backup of the database. This is the point to take one: it is the last state the previous release can read.
  5. Deploy and start the new major version (e.g., 10.0.0).
  6. Artemis then:
    • Reads the previous version from the artemis_version table and compares it against the required version.
    • Marks the baseline as applied without executing it, because your database already has that schema.
    • Applies the changelogs written since the last consolidation.
    • Writes the new version to the artemis_version table.

Artemis is not deployed as a rolling update. Stop every instance, start the first one alone and let it finish the migration, then start the rest. See Multiple Artemis Instances for the full procedure.

Upgrading Across Multiple Major Versions (e.g., 6.5.0 → 10.0.0)​

You must upgrade through each intermediate version sequentially:

  1. 6.5.0 → 6.9.6 (deploy 6.9.6, start, wait for full initialization)
  2. 6.9.6 → 7.10.5 (deploy 7.10.5, start, wait for full initialization)
  3. 7.10.5 → 8.8.6 (deploy 8.8.6, start, wait for full initialization)
  4. 8.8.6 → 9.9.3 (deploy 9.9.3, start, wait for full initialization)
  5. 9.9.3 → 10.0.0 (deploy 10.0.0, start, wait for full initialization)

Skipping a Required Version​

If you attempt to start a major version without having deployed the required intermediate version, Artemis will:

  1. Log an error message: "Cannot start Artemis because the migration path was not followed. Please deploy and start the release X.Y.Z first, otherwise the migration will fail"
  2. Exit with code 15.
  3. No database changes will be made.

To resolve this, deploy the required intermediate version first, start Artemis, wait for it to fully initialize, stop it, and then deploy the desired major version.

Verifying a Migration​

Artemis reports what it did with the schema in the startup log.

On an empty database, the folded history is recorded before the baseline runs:

Empty database: recording the folded changelog history from classpath:config/liquibase/history/master.xml without executing it
Recorded the folded changelog history

On an existing database, that line is absent and Liquibase reports only the changelogs that still had to run. In both cases the last migration step logs the version being stored:

Updating latest version to 10.0 in database

To confirm afterwards, check that the recorded version matches the release you deployed:

SELECT latest_version FROM artemis_version;

Liquibase records every changeset it applied or recorded in DATABASECHANGELOG. A row whose EXECTYPE is MARK_RAN was deliberately skipped, which on an upgraded database is the normal state of the baseline row. An empty DATABASECHANGELOG on an instance that has started successfully means Liquibase was disabled, usually through the no-liquibase profile.

If a Migration Fails​

A failing changeset stops the startup and the instance does not serve requests. The log names the changeset that failed and the statement it was running.

The steps below are for a migration failing on an existing database. A fresh installation failing while it records the folded history is a different case and needs nothing from you: the log reads "Recording the folded changelog history left N changeset(s) unrecorded", Artemis discards what it had recorded, and the next start repeats the whole step from the empty database it began with. Only if that message is followed by one saying the partial history could not be discarded do you have to act — drop the database and start again, because a half-recorded history would otherwise make the next start run the folded changelogs as ordinary migrations.

  1. Do not start the remaining instances. Only the first instance migrates, so the others are still stopped at this point.
  2. Read the failing changeset identifier from the log. Every changeset before it is committed and recorded; the failing one is not recorded.
  3. Resolve the underlying cause. A migration that adds a constraint usually fails because existing data violates it, and the log names the table and column.
  4. Restart the instance. Liquibase resumes at the changeset that failed and does not repeat the ones already recorded.

Restore the backup taken in step 4 of the upgrade procedure if the cause cannot be resolved. Reverting to the previous release on its own is not enough: the schema does not revert with it, and the older release may not be able to read the migrated schema.

Version-Specific Migration Steps​

Some releases change behavior in a way that requires a one-time action on existing data. These steps are additional to the upgrade scenarios above.

10.8: Configuration Keys That Spring Cannot Bind Any More​

Artemis now refuses to start when the configuration sets a key that Spring Boot or one of its libraries marks as removed or deprecated without a replacement key of the same type (spring.properties.migrator.fail: on-error, using spring-boot-properties-migrator). Before, such a key was ignored without a message, so a setting could stop working unnoticed.

Some of these keys still work. For example, Spring AI deprecated its chat memory, so spring.ai.chat.memory.repository.jdbc.initialize-schema is rejected although Spring AI still reads it. The check looks at every source of the environment, which includes environment variables, command-line arguments and a config server, not only the configuration files. A key that has a replacement of the same type is only renamed on the fly and logged as a warning, which does not stop the start.

The error log names each key and its source at the end of the start-up. Remove the key or replace it as described there, then start again. To start anyway while you fix the configuration, set spring.properties.migrator.fail (or the environment variable SPRING_PROPERTIES_MIGRATOR_FAIL) to never. The report stays in the log.

This release moves to Spring Boot 4.2, which renamed server.forward-headers-strategy to server.request.header.forwarded.strategy and its value native to web-server (framework and none keep their names). Artemis sets web-server. If your configuration sets the old key, replace it with the new key before you upgrade, and map its value. Do not only delete it: without a key, Artemis uses web-server, and then Tomcat believes X-Forwarded-For from the proxies in server.tomcat.remoteip.internal-proxies, see Client Address of Requests. Spring Boot refuses to start when both keys are set, and the old key alone is rejected by the check above.

10.8: Relative Redirects​

Tomcat now answers a redirect that the application gives as a relative address with a relative Location header instead of making it absolute: server.tomcat.servlet.use-relative-redirects (formerly server.tomcat.use-relative-redirects) defaults to true in Spring Boot 4.2. Browsers handle this, but a client or proxy that cannot follow a relative Location header needs server.tomcat.servlet.use-relative-redirects: false.

10.8: Error Tag of Server Error Metrics​

An exception that Spring handles and answers with a 5xx status is now recorded on the http.server.requests metric with its class name in the error tag, where it was none before. Requests with a 4xx status are not affected. If an alert or a dashboard counts error!="none" as an unexpected failure, it reports more server errors than before, although these requests already had outcome="SERVER_ERROR".

10.8: Embedding Artemis from LTI Platforms​

On an installation with LTI platforms, Artemis now sends frame-ancestors 'self' followed by the origins of these platforms, which it derives from the issuer and the authorization address of each platform. Without LTI platforms and without artemis.security.frame-ancestors nothing changes. Check where your learning management system serves the pages that embed Artemis. If that origin differs from the issuer and the authorization address of its platform, as it does for Canvas and for Blackboard Learn (issuer https://blackboard.com, authorization address at developer.blackboard.com), list the origin that embeds Artemis in artemis.security.frame-ancestors, otherwise the browser refuses to show Artemis in the frame. Artemis logs a warning for every platform from which it cannot derive any origin. See Embedding in Other Pages.

10.8: Host Key Check of Build Agents​

A build agent that clones over SSH (build-agent-use-ssh: true) now compares the SSH host key it is shown with the fingerprints that the core node publishes at api/localvc/public/ssh-fingerprints, and refuses a clone from a host with another key. Check that artemis.version-control.url on each agent reaches a core node, and that all core nodes behind one address share one host key (ssh-host-key-path). An agent that cannot read the fingerprints keeps cloning and logs a warning, unless you set artemis.version-control.ssh-host-key-verification: required on it. See Host key of the SSH server.

10.8: Submission Policy in Exercise Updates​

Updating a programming exercise with PUT /api/programming/programming-exercises no longer adds, changes or removes its submission policy. Before, a request that omitted the policy removed it without applying the effect of the removal to the participations. The policy is now managed only through the submission-policy endpoints of the exercise, which the grading page of the client uses. The client needs no change, because its edit page already shows the policy read-only. Scripts that changed a policy through the exercise update have to call the dedicated endpoints.

10.8: Rate Limit of Re-evaluations​

Re-evaluating all results of a programming exercise (PUT /api/programming/programming-exercises/{exerciseId}/grading/re-evaluate) and saving an exercise update with a re-evaluation (PUT /api/programming/programming-exercises/{exerciseId}/re-evaluate) together are limited to 6 requests per minute and user. Set artemis.rate-limiting.re-evaluation-requests-per-minute to change the limit. Instructors who exceed it receive a 429 response with a Retry-After header. Nothing else changes. See Rate Limiting.

10.8: Token in the Response of the Login​

POST /api/core/public/authenticate returns the session token in the JSON body (access_token) only when the request asks for it. The web application uses the cookie that the same response sets and does not read the body, so browsers are not affected. Clients that cannot use a cookie opt in with the query parameter returnToken=true. A request that carries a tool parameter, which is how tools such as Scorpio sign in, receives the token as before. If a script or a tool of yours reads access_token from the response without either parameter, add ?returnToken=true to its request before you upgrade.

10.8: External Logins and Internal Accounts​

A SAML2 or OpenID Connect login is refused when its login name belongs to an internal account, that is an account with a password of its own. Before, such a login signed in to the internal account and updated its data. Artemis logs a warning with the login name for every refused login, and the user is told to sign in with the Artemis password.

Accounts that an OpenID Connect login created are stored as external accounts and are not affected. Two groups of accounts are stored as internal accounts although a person may use them with an external login:

  • SAML2 accounts that Artemis created before version 9.9 and that nobody converted. They are still marked as internal. Clear the flag as described in Accounts Provisioned Through SAML2 before you upgrade, otherwise their owners can no longer sign in through the identity provider.
  • Accounts that an LTI launch created. Artemis creates them as internal accounts, and their login is the preferred_username of the launch. If the identity provider of a SAML2 or OpenID Connect login produces the same login name, that login is refused.

Before you upgrade, check that no person signs in to the same account both with a password and through the identity provider. Such an account has to use one way only. For SAML2, this query lists the internal accounts that signed in through the identity provider (the audit events are subject to your retention period, so a missing row is no proof):

SELECT u.login, u.email
FROM jhi_user u
WHERE u.is_internal = TRUE
AND u.login IN (SELECT e.principal
FROM security_audit_event e
WHERE e.event_type = 'SAML2_AUTHENTICATION_SUCCESS');

On a version before 10.0, read jhi_persistent_audit_event instead of security_audit_event. Artemis stores no audit event for a successful OpenID Connect login, so no comparable query exists for it. Compare the logins that your identity provider releases with the internal accounts instead. See OpenID Connect and SAML2.

10.8: Client Address of Requests​

Artemis takes the address of a client from the address that Tomcat resolved for the request, and no longer reads X-Forwarded-For or other address headers itself. This applies to all rate limits except the one for Git over HTTP, which counts the address as described in the section linked below, to the check of internal endpoints (artemis.security.internal.allowed-cidrs) and to the address that is stored in an exam session. Tomcat believes forwarding headers only from the proxies in server.tomcat.remoteip.internal-proxies, which are the private networks by default. If your reverse proxy reaches Artemis from a public address, name it there before you upgrade. Otherwise all clients have the address of the proxy, share one budget of the login rate limits, and appear with one address in their exam sessions. See Client Address of Git Requests.

10.8: Build Results in the Distributed Data​

With Redis or Valkey, this release changes the stored layout of build results (schema version 2). Finished build results that were still waiting in the result queues when you stop the old nodes are discarded, and their submissions need a new build. Queued builds are kept. A build that was still running when you stopped its node is marked as missing and rebuilt automatically after about five to ten minutes. Pause all build agents and wait until the running builds have finished and the result queues are empty before you upgrade. Hazelcast keeps nothing across a restart and is not affected. See Distributed Data with Redis or Valkey.

10.7: Rate Limit of Git Operations​

The authentication of git operations over HTTP and SSH has its own rate limit setting, artemis.rate-limiting.git-authentication-requests-per-minute (ARTEMIS_RATELIMITING_GITAUTHENTICATIONREQUESTSPERMINUTE), which is 30 per minute and client address unless you set it. Before, git shared authentication-requests-per-minute with the logins. After the upgrade, that value only applies to logins, and the two limits no longer add up to one: with the defaults, one client address may now make up to 30 login attempts and up to 30 git authentications per minute, where it could make 30 in total. With a login limit of your own, for example 300, an address that could make 300 requests of both kinds in total may now make 300 logins and 30 git authentications. That is more room for guessing a password, because git over HTTP can verify a password like a login does. Review the git limit on every installation, whether you raised, lowered or never set the login limit:

  • If you raised authentication-requests-per-minute so that a lecture hall behind one address could push at a deadline, set the git setting to the same value before you upgrade, or git drops to 30.
  • If you lowered it, for example to 5, to make guessing harder, set the git setting to the same value too, or git is at 30 while the logins stay at 5.
  • If you never set it, decide whether 30 git authentications per client address and minute is what you want next to 30 logins, and lower the git setting if not.

See Rate Limiting.

10.5: Email Changes Need Confirmation​

No data has to be migrated. The upgrade adds nullable columns to user_recovery_key, so the previous version keeps working after a rollback. Two behaviors change for users:

  • A user with an internal account changes the email address only after the owners of the current and of the new address have both followed a link in a mail. Without a configured mail server (jhipster.mail.from left at its default), nothing could be confirmed, so the field in the settings is disabled and only an administrator can change the address. Configure the mail server before you upgrade if users should keep changing their address themselves. The links point to /account/confirm-email-change on server.url, so that path has to reach the client.
  • A session that started before the credentials last changed, for example before a password reset, can no longer add a passkey, an SSH key or an access token. The client signs the user out and asks them to sign in again.

See Changing the email address and Sessions and new credentials.

10.4: Course-Level Science Data Collection​

Science data collection is enabled per course and needs each student's consent in that course. See Science Data Collection. The migration changes the science_event table on the first start:

  • It adds a course_id column and fills it for existing events from the lecture, lecture unit, exercise, competency, learning path or course each event refers to. Events whose resource no longer exists keep an empty course_id.
  • It adds a foreign key from course_id to course, so deleting a course deletes its science events, and two indexes, on course_id, timestamp, id and on identity, course_id.
  • It drops the science_setting table, which held the global science preference of each user. These preferences are not carried over: no course collects data until an administrator enables it, and the students of an enabled course are asked again.

The backfill, the foreign key and each index process the whole science_event table. On an instance that has collected events for a long time, that table can be large, so expect the first start to take correspondingly longer, and take the database backup described in the upgrade procedure right before you upgrade. Rolling the migration back recreates science_setting empty; the dropped preferences can only be restored from that backup.

10.1: Installation Metadata in Production​

Every production core node refuses to start until three settings describe who runs the installation, whether or not telemetry is enabled:

  • info.operatorName (INFO_OPERATORNAME): the organization operating Artemis.
  • info.operatorAdminName (INFO_OPERATORADMINNAME): the administrator's name.
  • info.universityName (INFO_UNIVERSITYNAME): the university, school, or institution using Artemis. This setting is new.

Empty values and template values such as Admin, Some Artemis Operator, Your University, or Anonymous University are rejected, and the error names each setting to correct. Development servers, test servers (info.testServer: true), and build agents start without them. Add all three to the configuration of every production core node before you upgrade:

  • Ansible: artemis_operator_name, artemis_operator_admin_name, and artemis_university_name. The collection has no defaults for them and stops the play on a core node where one is missing. Run the configuration update before the version update, because a version update does not rewrite the configuration.
  • Helm: artemis.config.operator.name, artemis.config.operator.adminName, and artemis.config.operator.universityName. The chart does not render while one of them is empty.
  • Docker Compose and manual installations: the environment variables or application-prod.yml.

The About page shows the values that are set. See Telemetry for the settings and for what the installation reports.

10.0: Connection Collation on MySQL​

Searches that match names, logins or titles compare both sides in lower case, so they behave the same on MySQL and PostgreSQL. On MySQL, this requires the connection to use utf8mb4_unicode_ci, like the tables. A JDBC URL without connectionCollation=utf8mb4_unicode_ci connects with utf8mb4_0900_ai_ci, and these searches then fail with Illegal mix of collations. Add the parameter to the datasource URL of every node before you upgrade. See MySQL Character Set and Collation. PostgreSQL installations need no action.

9.9: Accounts Provisioned Through SAML2​

The sign-in page asks for the identifier first and then decides, from the account's internal flag, whether to offer a password field or to send the user to the configured identity provider. Only an account marked as internal authenticates against a password stored in Artemis; every other account is sent to the identity provider.

An account is either internal or external, never both. An internal account authenticates against a password stored in Artemis; an external one authenticates against the identity provider that manages it. A SAML2 account belongs in the second group, alongside OIDC and LDAP.

Accounts that Artemis provisioned through SAML2 before version 9.9 are stored as internal accounts, so they are offered the password form instead of the identity provider. The password such an account holds is a random one that was never given to its owner, so the owner cannot sign in until the flag is cleared. Accounts provisioned from LDAP are not affected, because they have always been stored as externally managed.

Clearing the internal flag takes away everything that authenticates against a password stored in Artemis: the password form on the sign-in page, Change password, the password reset function, and Git over HTTPS with a password. VCS access tokens and SSH keys keep working, because neither is checked against the password, and they are what an externally managed account uses for Git.

Identifying the Affected Accounts​

Artemis records a SAML2_ACCOUNT_CREATE audit event whenever it provisions an account on a first SAML2 login, and the event names the account by its login. Match on login in every query on this page. It is the column Artemis constrains to be unique, and it is what Artemis itself looks the account up by when an assertion arrives: the login is derived from saml2.username-pattern, lowercased, and compared against jhi_user.login.

On version 9.9 these events are stored in jhi_persistent_audit_event, so the affected accounts can be listed exactly:

SELECT u.login, u.email
FROM jhi_user u
WHERE u.is_internal = TRUE
AND u.login IN (SELECT d.event_data
FROM jhi_persistent_audit_evt_data d
JOIN jhi_persistent_audit_event e ON e.event_id = d.event_id
WHERE d.name = 'user' AND e.event_type = 'SAML2_ACCOUNT_CREATE');

From version 10.0 on, the same events live in security_audit_event, with their key-value data in security_audit_evt_data. Substitute both table names in every query below.

If the audit log does not reach back far enough, build the list from the identity provider instead, and still match on login: export the accounts the identity provider manages, apply your configured saml2.username-pattern to each one to get the login Artemis would have stored, lowercase the result, and match jhi_user.login against that list.

Clearing the Flag​

For a few accounts, open Administration → Account → Users, edit the user, and clear the Internal checkbox.

For many accounts, update jhi_user.is_internal directly. Confirm that the SELECT above returns what you expect and that you have a backup, then run the update in a transaction:

BEGIN;
UPDATE jhi_user SET is_internal = FALSE
WHERE is_internal = TRUE
AND login IN (SELECT d.event_data
FROM jhi_persistent_audit_evt_data d
JOIN jhi_persistent_audit_event e ON e.event_id = d.event_id
WHERE d.name = 'user' AND e.event_type = 'SAML2_ACCOUNT_CREATE');
COMMIT;

Keep the internal administrator configured in artemis.user-management.internal-admin.username internal, and keep every other account that does authenticate against a password stored in Artemis internal as well. Accounts that Artemis provisions after the upgrade are stored correctly.

Database Compatibility​

Artemis supports both MySQL and PostgreSQL. The migration system works identically on both databases. The baseline is written in database-agnostic Liquibase types, in three changesets:

  • One shared changeset for everything both databases express the same way.
  • One for MySQL and H2, covering the columns those spell differently, such as enum and varbinary.
  • One for PostgreSQL, covering the same columns as varchar, text and bytea.

Every Artemis pull request applies the baseline and the changelogs it summarises to empty MySQL and PostgreSQL databases, and on each of them compares the baseline against the history it folds. A baseline that has drifted from its changelogs on either database therefore cannot reach a release.

MySQL Character Set and Collation​

The server gets the collation from the MySQL configuration, for example --character_set_server=utf8mb4 --collation-server=utf8mb4_unicode_ci, and a database created afterwards inherits it. The connection does not: MySQL Connector/J connects with utf8mb4_0900_ai_ci, the MySQL default for utf8mb4, even when the server is configured with utf8mb4_unicode_ci. Set the connection collation in the JDBC URL with connectionCollation=utf8mb4_unicode_ci:

spring:
datasource:
url: jdbc:mysql://<db-host>:3306/Artemis?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf8&connectionCollation=utf8mb4_unicode_ci&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC

With the environment variable SPRING_DATASOURCE_URL, append the same parameter. Without it, the searches that match names, logins or titles fail with an error like the following, for example when searching for conversation members or course members:

Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT), (utf8mb4_0900_ai_ci,IMPLICIT), (utf8mb4_0900_ai_ci,COERCIBLE) for operation 'like'

To check an installation, make sure the datasource URL of every node contains connectionCollation=utf8mb4_unicode_ci. Then check the defaults of the server and of the Artemis database, and the collation of its tables and text columns:

SHOW VARIABLES WHERE Variable_name IN ('character_set_server', 'collation_server');
SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = 'Artemis';
SELECT TABLE_NAME, TABLE_COLLATION FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'Artemis' AND TABLE_COLLATION <> 'utf8mb4_unicode_ci';
SELECT TABLE_NAME, COLUMN_NAME, COLLATION_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'Artemis' AND COLLATION_NAME IS NOT NULL AND COLLATION_NAME <> 'utf8mb4_unicode_ci';
  • The first two queries should return utf8mb4 and utf8mb4_unicode_ci. The server defaults matter even when the database is correct: with createDatabaseIfNotExist=true, a recreated Artemis database takes them over.
  • The other two should return no rows. A column can declare its own collation, so it can deviate even when its table does not. The Artemis schema declares no column collation, so a deviating column was changed outside of Artemis.

The server configuration only applies when a database is created, so changing it later leaves the default of an existing Artemis database as it was. If that default differs, change it with the following statement. It applies to the tables that later migrations create and does not convert existing tables:

ALTER DATABASE Artemis CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

PostgreSQL installations are not affected.

Technical Details​

The migration path check is implemented in DatabaseMigration.java. It runs before Liquibase on every application startup and reads the artemis_version table to determine the previous version. The MigrationPath class defines version boundaries:

MigrationPath("9.9.3")
→ requiredVersion = 9.9.3
→ upgradeVersion = 10.0.0 (next major)
→ nextUpgradeVersion = 11.0.0 (major after that)

When the version being started falls in [upgradeVersion, nextUpgradeVersion) and the recorded previous version is older than requiredVersion, Artemis logs the error and exits with code 15 before Liquibase runs. A database with no recorded version is a fresh installation and is always accepted.

Applying the changelogs is the job of ArtemisSpringLiquibase.java. It recognises an empty database — no DATABASECHANGELOG table, or one with no rows — and records the folded history with Liquibase's changelog-sync before running the update, using the same contexts and labels as the update itself.

A database is empty only until Liquibase has written its first row, so the recording happens exactly once in the life of an installation. There is nothing to configure and nothing to run by hand.

Search documentation