Migration from Windows to Docker

This guide walks step by step through migrating an existing Relution installation on a Windows Server to a modern Docker-based installation on a Linux server.

Each section should be read in full before any command is run.

What happens during this migration?

The current Relution installation runs on a Windows Server with a MariaDB database. The new setup runs on a Linux server in so-called “containers” (Docker). The difference that makes this migration necessary: Windows does not distinguish between uppercase and lowercase in file names and table names. Linux, on the other hand, does. That is why certain table names in the database must be converted to uppercase after the move – there is a ready-made script for this at the end.

The migration runs through these phases:

  1. Create a backup (dump) of the database on the Windows Server
  2. Prepare the new Linux server with Docker
  3. Import the backup into the new database
  4. Rename table names to uppercase
  5. Start Relution and verify
The new environment continues to use MariaDB, in the example version 10.11, the minimum version required by Relution. MariaDB is supported by Relution until the end of 2027; PostgreSQL is recommended. A later switch is described under Migration from MariaDB to PostgreSQL →.

Prerequisites before starting

The following is required:

  • Access to the Windows Server (directly on site or via Remote Desktop / RDP)
  • The name of the Relution database – if unknown, ask the administrator or look it up in the existing Relution configuration file. Often the name is simply relution.
  • The password of the MariaDB database user (usually root or a dedicated Relution user)
  • The installed Relution version on the Windows Server; it determines the image with which Relution is first started in Docker (see Phase 2)
  • A Linux server with a supported operating system (Alma Linux or Rocky Linux 9/10 or RHEL 9 and later, see System requirements →), on which Docker and Docker Compose are already installed (see Docker (Recommended) →)
  • Access to the Linux server via SSH (a terminal program such as PuTTY on Windows or the built-in terminal on macOS/Linux)
  • A file transfer program such as WinSCP → (free) to copy files from the Windows Server to the Linux server

Phase 1 – Create a backup on the Windows Server

In this step, a complete backup copy of the Relution database is created as an SQL file. This file contains all the data and will be imported into the new environment later.

1.1 Open the Command Prompt as Administrator

  1. On the Windows Server, the key combination Windows+R is pressed
  2. cmd is entered and Ctrl+Shift+Enter is pressed (not just Enter) – this opens the Command Prompt with administrator privileges
  3. The security prompt is confirmed with Yes

1.2 Create the target folder for the backup

The following command is entered and confirmed with Enter:

mkdir C:\backup

This command creates the folder C:\backup, in which the backup file is stored. If the folder already exists, a harmless message appears and the process can be continued.

1.3 Find the database path

mysqldump is the program that creates the backup. It is located in the MariaDB installation directory. The following command shows which path applies on the system:

dir "C:\Program Files\MariaDB*"

A folder named MariaDB 10.6 or MariaDB 10.11 should then be visible directly under C:\Program Files. The exact version number is noted – it is needed in the next step.

1.4 Create the database dump

Before the export, the Relution service on the Windows Server is stopped so that no data is written after the dump that would be missing in the new environment:

sc stop relution

In the following command, 10.11 is replaced with the actual MariaDB version number and relution with the name of the database, if it differs:

"C:\Program Files\MariaDB 10.11\bin\mysqldump.exe" -u root -p --single-transaction --routines --triggers --default-character-set=utf8mb4 --max-allowed-packet=1G relution > C:\backup\relution_dump.sql

After pressing Enter, a prompt for the database password appears. The password is entered (the input is invisible – this is normal) and confirmed with Enter.

If no error appears and the normal input prompt reappears, the export was successful.

Brief explanation of the options used:

OptionMeaning
-u rootLog in as database user root
-pPassword is prompted interactively
--single-transactionBackup without locking the database (consistent state)
--routinesStored procedures are backed up as well
--triggersTriggers are backed up as well
--default-character-set=utf8mb4Character set for special characters and emojis
--max-allowed-packet=1GAllows large rows, e.g. files stored in the database

1.5 Verify the backup

The following command checks whether the file was created correctly:

dir C:\backup\relution_dump.sql

The file should appear with a size (typically several MB). If the file is 0 bytes, something went wrong – in that case, the command from 1.4 is run again while watching for error messages.

1.6 Transfer the files to the Linux server

In WinSCP, a connection to the Linux server is established (IP address, username and password) and two files are copied:

FileSource (Windows)Destination (Linux)
Database dumpC:\backup\relution_dump.sql/opt/relution/relution_dump.sql
Relution configuration%ProgramFiles%\relution\application.yml/opt/relution/application.yml

Among other things, the application.yml contains the external URL of the server and is reused in the new environment. If Relution is located in a different directory on the Windows Server, the file is in that installation directory.

If the folder /opt/relution/ does not yet exist on the Linux server, it is created first (see Phase 2, step 2.1).


Phase 2 – Prepare the Linux server

All of the following commands are run on the Linux server in an SSH terminal.

2.1 Create the working directory

mkdir -p /opt/relution
cd /opt/relution

The command mkdir -p creates the folder and all parent folders if they do not yet exist. cd switches into this folder.

2.2 Create the Docker Compose file

Docker Compose is a method for starting and managing several related programs (here: database + Relution) together. The configuration is stored in a file named compose.yaml.

The file is created with:

nano /opt/relution/compose.yaml

The command nano opens a simple text editor directly in the terminal. The following content is copied into it in full:

Show full configuration example
version: "3.8"

services:
  mariadb:
    image: mariadb:10.11
    container_name: relution-db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: <ROOT_PASSWORD>
      MYSQL_DATABASE: relution
      MYSQL_USER: relution
      MYSQL_PASSWORD: <RELUTION_PASSWORD>
    volumes:
      - mariadb_data:/var/lib/mysql
      - ./database.cnf:/etc/mysql/conf.d/database.cnf:ro
    networks:
      - relution-net

  relution:
    image: relution/relution:<VERSION>
    container_name: relution-app
    restart: unless-stopped
    depends_on:
      - mariadb
    ports:
      - "8080:8080"
    environment:
      DATABASE_TYPE: mariadb
      DATABASE_URL: jdbc:mariadb://mariadb:3306/relution?useServerPrepStmts=true
      DATABASE_USER: relution
      DATABASE_PWD: <RELUTION_PASSWORD>
    volumes:
      - ./application.yml:/opt/relution/application.yml
    networks:
      - relution-net

volumes:
  mariadb_data:

networks:
  relution-net:

The three placeholders are replaced with secure passwords of choice:

  • <ROOT_PASSWORD> → e.g. Tr0mmelFeuer!92
  • <RELUTION_PASSWORD> → e.g. Rel@ution#2024 (both occurrences, MYSQL_PASSWORD and DATABASE_PWD, must be identical!)

<VERSION> is replaced with the Relution version of the Windows installation, e.g. relution/relution:26.0.3. On the first start, Relution updates the database to the version of the image; a fixed tag prevents an unplanned update across several versions.

If the Windows installation still runs Relution 5.x, Relution 26.1 and later does not start with this database. The start aborts with the message An update from version 5 to 26.1+ detected. In this case, Relution is first started with relution/relution:5.35.4, then with relution/relution:26.0.3, and only then is a current version set, see Update →. If the Windows installation is already on 26.0.x or later, the tag of that version or latest is sufficient.

Port 8080 is only intended for the first test; access from outside is later provided via a reverse proxy with HTTPS (see Phase 5).

The file is saved and closed with Ctrl+O (save), then Enter, then Ctrl+X (exit).

2.3 Create the database configuration

The file database.cnf sets the character set, collation and maximum packet size of the database server in line with the Relution default configuration:

nano /opt/relution/database.cnf
[mysqld]
collation-server=utf8mb4_general_ci
character-set-server=utf8mb4
max_allowed_packet=1G
innodb_file_per_table=1

The main reason is max_allowed_packet: Relution can store files as single rows in the database. With the MariaDB default (16 MB), importing such rows fails. The character set and collation settings serve as a safeguard, as newer MariaDB images use a different default collation.

The file must be in place before the first start of the database container (step 2.5), as the relution database is only created with these server settings during the first initialization.

The file is saved and closed with Ctrl+O, Enter, Ctrl+X.

2.4 Adjust the application.yml

nano /opt/relution/application.yml

In the application.yml taken over from Windows, the database section below relution is removed completely, e.g.:

  database:
    type: mariadb
    url: jdbc:mariadb://localhost/relution?useServerPrepStmts=true
    username: relution
    password: ...

The database connection is defined via the DATABASE_* environment variables in the compose.yaml; a remaining database section would take precedence and still point to the old database. All other entries, in particular externalURL, remain unchanged.

The file is saved and closed with Ctrl+O, Enter, Ctrl+X.

2.5 Start only the database

Only the database container is started first – not Relution itself yet. This is important so that on its first start Relution does not encounter an empty database and begin creating its own (incorrect) tables.

cd /opt/relution
docker compose up -d mariadb

The option -d stands for “detached” – the container runs in the background and does not block the terminal.

2.6 Wait until the database is ready

docker logs -f relution-db

This command displays the logs (log messages) of the database container in real time. The following message indicates that the database is ready:

[Note] mariadbd: ready for connections.

As soon as this message is visible, Ctrl+C stops the display. The database continues running in the background.

Afterwards, the following command checks whether the database configuration from step 2.3 is in effect:

docker exec -it relution-db mariadb \
  -u root -p<ROOT_PASSWORD> \
  -e "SHOW VARIABLES LIKE 'collation_server';"

The output must contain utf8mb4_general_ci. Otherwise, the database.cnf file is not mounted; background information under Fix MariaDB collation →.


Phase 3 – Import the backup

If the dump file has not yet been transferred to the server, this is done now (see Phase 1, step 1.6).

3.1 Import the dump into the database

docker exec -i relution-db mariadb \
  -u root -p<ROOT_PASSWORD> \
  --max-allowed-packet=1G \
  relution < /opt/relution/relution_dump.sql
There is no space between -p and the password. <ROOT_PASSWORD> is replaced with the root password assigned in the compose.yaml.

A brief explanation of what happens here: docker exec -i relution-db runs a command inside the running database container. mariadb ... < file.sql imports the SQL file into the database.

The import may take a few minutes depending on the amount of data. If no error appears and the normal prompt reappears, the import was successful.

3.2 Verify the import

docker exec -it relution-db mariadb \
  -u root -p<ROOT_PASSWORD> \
  relution -e "SHOW TABLES;" | head -30

This command lists the first 30 tables of the database. Familiar table names should appear (e.g. databasechangelog, qrtz_triggers, etc.). If the list is empty or an error message appears, Phase 3 must be repeated.


Phase 4 – Rename table names to uppercase

As explained at the outset: Linux distinguishes between uppercase and lowercase, Windows does not. On Linux, Relution expects table names in uppercase. This step renames all affected tables.

Since a table cannot be renamed directly from example to EXAMPLE (Linux sees this as the same name), the renaming runs in two rounds: first to temporary names (with _tmp), then to the final uppercase names.

4.1 Create the script file

nano /opt/relution/rename_tables.sql

The following content is copied into the editor in full:

Show full configuration example
-- ============================================================
-- Step 1: Rename to temporary names (_tmp)
-- ============================================================
RENAME TABLE
  `databasechangelog`         TO `databasechangelog_tmp`,
  `databasechangeloglock`     TO `databasechangeloglock_tmp`,
  `jgroupsping`               TO `jgroupsping_tmp`,
  `qrtz_blob_triggers`        TO `qrtz_blob_triggers_tmp`,
  `qrtz_calendars`            TO `qrtz_calendars_tmp`,
  `qrtz_cron_triggers`        TO `qrtz_cron_triggers_tmp`,
  `qrtz_fired_triggers`       TO `qrtz_fired_triggers_tmp`,
  `qrtz_job_details`          TO `qrtz_job_details_tmp`,
  `qrtz_locks`                TO `qrtz_locks_tmp`,
  `qrtz_paused_trigger_grps`  TO `qrtz_paused_trigger_grps_tmp`,
  `qrtz_scheduler_state`      TO `qrtz_scheduler_state_tmp`,
  `qrtz_simple_triggers`      TO `qrtz_simple_triggers_tmp`,
  `qrtz_simprop_triggers`     TO `qrtz_simprop_triggers_tmp`,
  `qrtz_triggers`             TO `qrtz_triggers_tmp`,
  `scheduler_lock`            TO `scheduler_lock_tmp`;

-- ============================================================
-- Step 2: Rename to final uppercase names
-- ============================================================
RENAME TABLE
  `databasechangelog_tmp`         TO `DATABASECHANGELOG`,
  `databasechangeloglock_tmp`     TO `DATABASECHANGELOGLOCK`,
  `jgroupsping_tmp`               TO `JGROUPSPING`,
  `qrtz_blob_triggers_tmp`        TO `QRTZ_BLOB_TRIGGERS`,
  `qrtz_calendars_tmp`            TO `QRTZ_CALENDARS`,
  `qrtz_cron_triggers_tmp`        TO `QRTZ_CRON_TRIGGERS`,
  `qrtz_fired_triggers_tmp`       TO `QRTZ_FIRED_TRIGGERS`,
  `qrtz_job_details_tmp`          TO `QRTZ_JOB_DETAILS`,
  `qrtz_locks_tmp`                TO `QRTZ_LOCKS`,
  `qrtz_paused_trigger_grps_tmp`  TO `QRTZ_PAUSED_TRIGGER_GRPS`,
  `qrtz_scheduler_state_tmp`      TO `QRTZ_SCHEDULER_STATE`,
  `qrtz_simple_triggers_tmp`      TO `QRTZ_SIMPLE_TRIGGERS`,
  `qrtz_simprop_triggers_tmp`     TO `QRTZ_SIMPROP_TRIGGERS`,
  `qrtz_triggers_tmp`             TO `QRTZ_TRIGGERS`,
  `scheduler_lock_tmp`            TO `SCHEDULER_LOCK`;

The file is saved and closed with Ctrl+O, Enter, Ctrl+X.

4.2 Run the script

docker exec -i relution-db mariadb \
  -u root -p<ROOT_PASSWORD> \
  relution < /opt/relution/rename_tables.sql

If no error message appears, the renaming was successful.

4.3 Verify the result

docker exec -it relution-db mariadb \
  -u root -p<ROOT_PASSWORD> \
  relution -e "SHOW TABLES;"

The output should now show table names in uppercase, for example:

DATABASECHANGELOG
DATABASECHANGELOGLOCK
JGROUPSPING
QRTZ_BLOB_TRIGGERS
...

Phase 5 – Start Relution

As soon as the database is correctly populated and prepared, the full stack including Relution is started:

cd /opt/relution
docker compose up -d

5.1 Monitor the startup

docker logs -f relution-app

On its first start, Relution performs various database checks – this can take 1–3 minutes. The startup was successful when a line like the following appears (the line begins with a timestamp and the log level):

Started Main in XX seconds (process running for XX)

Ctrl+C exits the log view.

5.2 Set up HTTPS

Relution rejects logins over unencrypted HTTP from other computers. Access from the network and for devices therefore requires a reverse proxy with TLS. The Compose file above does not contain a reverse proxy; the traefik service with an automatic Let’s Encrypt certificate is added as described under Docker (Recommended) →, or alternatively nginx with a certificate according to SSL Certificates - Certbot →.

The external URL (externalURL in the application.yml) remains unchanged, as the devices are bound to this URL. The DNS record of this URL is switched to the new Linux server.

5.3 Open Relution in the browser

Relution is opened in the browser via the external URL, e.g. https://mdm.example.com.

A pure function test over HTTP is only possible directly on the Linux server via http://localhost:8080. From another computer, a login over HTTP results in the message “Access is forbidden”, and the log shows TLS required, see Login: Access is forbidden →.

Common problems and solutions

Table doesn't exist when running the rename script This means the dump import was not complete. SHOW TABLES; shows which tables are missing; Phase 3 is then repeated.

Relution does not start / gets stuck in a loop The logs are shown with docker logs relution-app. The most common causes are missing or incorrect DATABASE_* variables or an incorrect database password in the compose.yaml, a remaining database section in the application.yml, or tables that have not yet been renamed correctly. If An update from version 5 to 26.1+ detected appears, the intermediate step via 5.35.4 and 26.0.3 is missing (see Phase 2, step 2.2).

The dump file is 0 bytes The export command did not work. The path to mysqldump.exe and the database password should be checked.

Port 8080 is already in use Another program is using port 8080. In the compose.yaml, the line "8080:8080" is changed to e.g. "8181:8080"; Relution is then accessed on port 8181.

WinSCP does not connect The SSH service must be running on the Linux server (sudo systemctl status sshd) and the firewall must allow port 22.


Summary of the most important file paths

FilePath on the Linux server
Docker Compose configuration/opt/relution/compose.yaml
Relution configuration/opt/relution/application.yml
Database configuration/opt/relution/database.cnf
Database dump/opt/relution/relution_dump.sql
Rename script/opt/relution/rename_tables.sql

Next steps after a successful migration

Once Relution is running and login succeeds:

  • All devices, users and settings are checked for correct transfer
  • If an older version was started first, Relution is then updated to the current version, see Update →
  • Regular backups of the database (volume mariadb_data or a regular database dump) and of the application.yml are set up
  • The old Windows Server is only shut down once the new environment has run stably for several days

How helpful was this article?