โ˜• XOPSSCHOOL โ€” LEARNING MADE AFFORDABLE
Build the Skills Your Next Career Move Demands.
For the Price of One Coffee a Month.
Why spend hundreds on individual courses? Unlock an entire year of technical learning with one Coffee Pass.
US$4.90 /month
US$58.80/year
โ‚น499 + GST/month
โ‚น5,988 + GST/year
โ‚ฌ4.90 /month
โ‚ฌ58.80/year
12 Months of Access • Billed Annually • No Automatic Renewal
DevOps • Cloud • SRE • Kubernetes • Terraform • DevSecOps • AI • AIOps • MLOps • LLMOps • FinOps • GitOps • Platform Engineering & Much More
192
Premium Courses
1,085
Video Sessions
99
Ops Disciplines
86
Tool Courses
340
Assignments
227
Quizzes
โœ“ QR-Verifiable Certificates   โœ“ Learn at Your Own Pace   โœ“ Hands-on Learning   โœ“ New Courses Included
Learn from real-world, instructor-led video sessions by
Rajesh Kumar
Principal Architect • Trainer • Mentor • 15+ Years of Industry Experience
โ˜• Get My Coffee Pass โ€” Start Learning Today →
One Payment. Every Premium Course. One Full Year.
The best investment you can make is in the person you are becoming.

Rundeck Database Migration From H2 to MySql and postgresql

This guide moves Rundeck off its embedded H2 database and onto MySQL or PostgreSQL, which is what you should use in production. The steps above set up MySQL. Below you will find fixes for MySQL 8, the matching PostgreSQL setup, the dataSource settings for each database, and how to move your existing jobs and execution history. Changing the dataSource on its own does not copy any data.

Rundeck Database Migration From H2 to MySql

Step 1 – Install mySql Server

Step 2 – Create rundeck db and rundeckuser and set their permissing


$ mysql -u root -p
mysql> create database rundeck;
mysql> grant ALL on rundeck.* to 'rundeckuser'@'localhost' identified by 'rundeckpassword';
$ mysql -u rundeckuser -p
mysql> show databases;Code language: JavaScript (javascript)

Step 3 – Configuring Rundeck to connect to mysql DB

Update your rundeck-config.properties file with settings from the following database list and restart Rundeck. This file is located in different locations depending on your installation method:

  • RPM/DEB: /etc/rundeck/rundeck-config.properties
  • WAR/Custom: $RDECK_BASE/server/config/rundeck-config.properties
Rundeck docs showing MySQL dataSource url, username, password and driver settings for rundeck-config.properties
Rundeck-config.properties with grails.serverURL and MySQL dataSource settings highlighted

Step 4 – Change Server URL of grails.serverUrl

The configuration option grails.serverUrl must be set properly. The value should match the URL users would use to access Rundeck(ie the URL they would enter into the browser).

For Docker this should be configured with the RUNDECK_GRAILS_URL environment variable.
For deb, rpm, and war this will be set as grails.serverUrl= in the rundeck-config.properties file

Step 5 – Copy MySQL JDBC Driver

To use the Oracle MySQL driver download it and copy it to the $RDECK_BASE/server/lib for war launcher or in /var/lib/rundeck/lib (create it) for RPM and DEB installations.


$ mkdir /var/lib/rundeck/lib
$ MYSQLJ_VERS=8.0.21
$ curl -L -o https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQLJ_VERS}/mysql-connector-java-${MYSQLJ_VERS}.jar
Code language: JavaScript (javascript)

Step 6 – restart Rundeck

$ sudo service rundeckd restart

Why move off H2, and what migration really means

A fresh Rundeck install stores everything in an embedded H2 file database under /var/lib/rundeck/data. That includes jobs, execution history, project configuration and, by default, Key Storage. H2 is fine for a trial. It is not suitable for production: it does not support clustering, it is hard to back up while Rundeck is running, and the files can be corrupted after an unclean shutdown.

When you point rundeck-config.properties at a new database, Rundeck starts against an empty schema and creates its tables on the first start. Nothing is copied over from H2. There is no built-in tool that converts H2 to MySQL or PostgreSQL. The supported way to migrate is to export your projects from the old setup and import them into the new one, as described below.

Note: Before you change anything, stop Rundeck and back up /var/lib/rundeck/data, /etc/rundeck and /var/lib/rundeck/logs. If something goes wrong, restoring these and reverting the config puts you back on H2.

Corrected MySQL database and user setup

The GRANT ... IDENTIFIED BY statement in step 2 above was removed in MySQL 8.0. On MySQL 8 it fails with a syntax error. You now create the user first and then grant privileges. Creating the database with utf8mb4 also avoids character set problems with job definitions that contain non-ASCII text.

$ sudo mysql -u root -p
mysql> CREATE DATABASE rundeck CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> CREATE USER 'rundeckuser'@'localhost' IDENTIFIED BY 'Use-A-Strong-Password';
mysql> GRANT ALL PRIVILEGES ON rundeck.* TO 'rundeckuser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> exit

$ mysql -u rundeckuser -p -e 'SHOW DATABASES;'Code language: PHP (php)

The last command should list rundeck together with information_schema. If MySQL runs on a different host from Rundeck, replace 'localhost' with the Rundeck server's IP address or a suitable host pattern. A user created for localhost cannot log in from another machine.

Corrected JDBC driver download

The curl command in step 5 above is broken. -o expects a file name, so it treats the URL as the output file name and has nothing left to download. The Maven artifact was also renamed from mysql:mysql-connector-java to com.mysql:mysql-connector-j in later 8.0.x releases. Pick a current Connector/J version from Maven Central and set MYSQLJ_VERS to it.

$ sudo mkdir -p /var/lib/rundeck/lib
$ MYSQLJ_VERS=<connector-j-version>   # an 8.x or 9.x release from Maven Central
$ sudo curl -fL -o /var/lib/rundeck/lib/mysql-connector-j-${MYSQLJ_VERS}.jar \
    https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/${MYSQLJ_VERS}/mysql-connector-j-${MYSQLJ_VERS}.jar
$ sudo chown -R rundeck:rundeck /var/lib/rundeck/lib
$ ls -l /var/lib/rundeck/libCode language: PHP (php)

Note: Rundeck already ships with MariaDB and PostgreSQL JDBC drivers. You only need this jar if you want to use the Oracle MySQL driver class com.mysql.cj.jdbc.Driver. If you use the bundled org.mariadb.jdbc.Driver instead, skip this step.

dataSource settings for MySQL and PostgreSQL

The screenshots above show the database settings. Below they are as text you can copy. In rundeck-config.properties, replace or comment out the existing H2 dataSource.url line. Do not leave two dataSource.url entries in the file.

# /etc/rundeck/rundeck-config.properties  (MySQL with Oracle Connector/J)
grails.serverUrl=http://rundeck.example.com:4440
dataSource.driverClassName=com.mysql.cj.jdbc.Driver
dataSource.url=jdbc:mysql://localhost:3306/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
dataSource.username=rundeckuser
dataSource.password=Use-A-Strong-Password

# Alternative: bundled MariaDB driver (no extra jar needed)
# dataSource.driverClassName=org.mariadb.jdbc.DriverCode language: PHP (php)

allowPublicKeyRetrieval=true is required when MySQL 8 uses its default caching_sha2_password authentication over a connection without TLS. In production, enable TLS on MySQL and set useSSL=true, or sslMode=REQUIRED with Connector/J. Do not disable encryption across a network.

# /etc/rundeck/rundeck-config.properties  (PostgreSQL, bundled driver)
grails.serverUrl=http://rundeck.example.com:4440
dataSource.driverClassName=org.postgresql.Driver
dataSource.url=jdbc:postgresql://localhost:5432/rundeck
dataSource.username=rundeckuser
dataSource.password=Use-A-Strong-PasswordCode language: PHP (php)

Older guides also set dataSource.dialect. Current Rundeck releases detect the dialect from the connection, so you only need to set it if your version's documentation says to. For Docker, use the environment variables RUNDECK_DATABASE_DRIVER, RUNDECK_DATABASE_URL, RUNDECK_DATABASE_USERNAME, RUNDECK_DATABASE_PASSWORD and RUNDECK_GRAILS_URL instead of editing the file.

PostgreSQL database setup

The original post covers MySQL only. For PostgreSQL, make rundeckuser the owner of the database. Since PostgreSQL 15, ordinary users can no longer create objects in the public schema by default, so a plain GRANT ALL ON DATABASE is not enough. Making the user the owner avoids that problem.

$ sudo -u postgres psql
postgres=# CREATE USER rundeckuser WITH PASSWORD 'Use-A-Strong-Password';
postgres=# CREATE DATABASE rundeck OWNER rundeckuser ENCODING 'UTF8';
postgres=# \q

$ psql -h localhost -U rundeckuser -d rundeck -c 'SELECT current_user;'Code language: PHP (php)

If the test login fails with password authentication failed or no pg_hba.conf entry, add a host rundeck rundeckuser 127.0.0.1/32 scram-sha-256 line to pg_hba.conf (use the Rundeck server's address if it runs on another host). Then reload PostgreSQL with sudo systemctl reload postgresql.

Moving existing jobs and history from H2

  1. While Rundeck is still running on H2, open each project and go to Project Settings > Export Archive. Include jobs, executions, configuration and ACLs. Save the .jar archive files.
  2. Write down every secret in Key Storage (passwords and SSH keys). By default these are stored in the H2 database, and project archives do not include them.
  3. Stop Rundeck with sudo systemctl stop rundeckd, back up the H2 data, then make the rundeck-config.properties changes described above.
  4. Start Rundeck with sudo systemctl start rundeckd and follow /var/log/rundeck/service.log until the schema has been created and the server reports it has started.
  5. Create each project again with the same name, then use Project Settings > Import Archive to load its .jar file.
  6. Add the Key Storage entries again at the same paths so jobs and node sources can still find them.
  7. Run a few jobs and check that the execution history and job schedules look correct.

If you use the rd command-line tool, rd projects archives export -p NAME -f NAME.jar and rd projects archives import -p NAME -f NAME.jar let you script steps 1 and 5 when you have many projects.

Verify the new database is in use

$ sudo systemctl restart rundeckd
$ sudo tail -f /var/log/rundeck/service.log

# MySQL
$ mysql -u rundeckuser -p rundeck -e 'SHOW TABLES;' | head
# PostgreSQL
$ psql -h localhost -U rundeckuser -d rundeck -c '\dt' | headCode language: PHP (php)

You should see Rundeck tables such as execution and scheduled_execution. If the database is still empty after a successful start, Rundeck is probably reading a different config file or is still pointing at H2. Run grep dataSource /etc/rundeck/rundeck-config.properties to check. On current systems, systemctl restart rundeckd does the same job as the service command in step 6 above.

Common errors and fixes

Error in service.logCauseFix
ClassNotFoundException: com.mysql.cj.jdbc.DriverThe jar is missing from /var/lib/rundeck/lib, or the rundeck user cannot read itCheck the file exists and its ownership, or switch to the bundled org.mariadb.jdbc.Driver
Public Key Retrieval is not allowedMySQL 8 caching_sha2_password over a connection without TLSAdd allowPublicKeyRetrieval=true or enable TLS
Access denied for user 'rundeckuser'@'...'The user's host does not match where Rundeck connects from, or the password is wrongCreate the user for the correct host and check dataSource.password
permission denied for schema publicPostgreSQL 15+ default privilegesMake rundeckuser the database owner, or run GRANT ALL ON SCHEMA public TO rundeckuser
Login redirects to localhost:4440grails.serverUrl is wrongSet it to the URL users actually open in the browser

Note: rundeck-config.properties holds the database password in plain text. Restrict the file with chmod 640 and chown root:rundeck. Give the database user privileges on the rundeck database only.

Frequently asked questions

Does changing the dataSource migrate my Rundeck data from H2?

No. Rundeck creates a new empty schema in MySQL or PostgreSQL. To keep jobs and history, export project archives before you switch and import them afterwards.

Do I need to download a JDBC driver for Rundeck?

Usually not. Rundeck bundles MariaDB and PostgreSQL drivers. The MariaDB driver works with MySQL. You only need to add the Oracle Connector/J jar if you want to use com.mysql.cj.jdbc.Driver.

Why does GRANT … IDENTIFIED BY fail on MySQL 8?

MySQL 8.0 removed the ability to create a user through GRANT. Run CREATE USER ... IDENTIFIED BY ... first, then GRANT ALL PRIVILEGES ON rundeck.* TO ....

Are Key Storage secrets included in a project archive?

No. With the default database-backed Key Storage, passwords and keys stay in the old database. You must add them again at the same paths after the migration.

Where is rundeck-config.properties located?

For RPM and DEB installs it is /etc/rundeck/rundeck-config.properties. For WAR installs it is $RDECK_BASE/server/config/rundeck-config.properties. Docker images are configured through RUNDECK_DATABASE_* environment variables.

Related tutorials

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals

Related Posts

How to Configure Rundeck with postgresql

Step 1 – Setup PostgreSQL server Step 2 – Login to PostgreSQL server & create user/db & grant perm Step 3 – Download PostgreSQL driver cd /var/lib/rundeck/libextsudo…

Read More

How to Migrate Sonarqube from H2 to Postgresql?

This page shows how to move SonarQube off its embedded H2 database and onto PostgreSQL: run PostgreSQL in Docker, point sonar.properties at it, set the kernel limits…

Read More

How to Work with Rundeck Webhooks?

A Rundeck webhook is a project-level HTTP endpoint. When it receives a POST request, a handler plugin runs, usually one that starts a job and passes values…

Read More

Step by Step Guide to Monitor PostGreSQL using Zabbix Agent

To monitor PostgreSQL with the classic Zabbix agent, you install the agent on the database host, create a read-only monitoring role, and deploy the user parameters and…

Read More

Deploying Nexus Certificate Manager (CM) and Protocol Gateway (PGWY) on Kubernetes

Step-by-step tutorial, written from an actual deployment of Certificate Manager 8.15.1-1 (CF server image 8.15.1-1, PGW image 8.15.1-1) on a 2-node kubeadm cluster. Status of this document (2026-11-12) Steps 1-8 were executed…

Read More

OpenShift Lab 9: Work with Databases in the OpenShift Web Console

Lab Goal In this lab, you will deploy a PostgreSQL database on OpenShift Local using the OpenShift web console. You will create the database using modern OpenShift…

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
GaryG
GaryG
4 years ago

That is not a migration, My data in the H2 did not migrate to the mysql database.
Gary

1
0
Would love your thoughts, please comment.x
()
x