Skip to content

Database (EN)

Claude edited this page Nov 14, 2026 · 1 revision

Database: H2, Derby, connections and backup (EN)

  • PostgreSQL is supported (setup assistant › database server › PostgreSQL, host:5432); MySQL/MariaDB uses Connector/J 8.4.
  • New databases (H2, MySQL, PostgreSQL) are created in one step from src/main/resources/db/schema.sql, the neutral structure of the current version, converted per database by SqlDialect (identity columns, large objects, triggers); updates only run for older existing databases. A new update: add it to DatabaseUpdater, raise Constants.DATABASE_VERSION, run ./gradlew generateSchema.
  • MySQL limits: search and trash bin need triggers – the user needs the TRIGGER privilege (with binary logging also SUPER or log_bin_trust_function_creators = 1); without them the update 1.1986 goes on with a warning and search/trash bin do not work. Existing MySQL databases get the triggers and a filled search index with update 1.1986; the old MySQL updates 1.1974–1.1982 (Derby syntax) were fixed.
  • New installations use H2, stored in <user home>/.yabs/h2 (<name>.mv.db); Derby databases keep working. H2 runs the Derby schema and updates, converted (SMALLINT → BIGINT, Derby triggers via the Java trigger H2Trigger).
  • Developer mode: java -jar openyabs.jar -devmode (or -Dyabs.devmode=true) – H2 in memory only, settings in a temporary folder (e.g. /tmp/yabs-dev…); nothing is kept, the setup assistant appears on every start. Start without -devmode for a real installation.
  • Connection Manager (File › Connection Manager): list of all databases, sign in and connect in one step (falls back to the previous one on failure), new database via the setup assistant without restart, add an existing H2/Derby database, rename, remove (only the entry).
  • Zip backup (Control Panel › Database): closes the database, zips it as <name>-<yyyyMMdd-HHmmss>.zip into a folder with variables (default [APPDIR]/backups/[DBNAME]), reconnects; keeps 3 by default; optionally at every exit. Restore unzips next to the zip and adds a new connection "Backup " – nothing is overwritten.
  • Derby backup, SQL export, restore and Tools › Migration are hidden until they are tested with H2.

Deutsch: Datenbank

Clone this wiki locally