Database DevOps Onboarding Guide
This onboarding guide accelerates your adoption journey by walking you through the essential setup steps from defining your database schemas to deploying versioned changes consistently across environments. Whether you use Liquibase or Flyway configurations, Harness orchestrates the full migration lifecycle within your Kubernetes infrastructure, ensuring predictable, auditable, and scalable database operations.
Prerequisites
Before beginning the walkthroughs in this guide, ensure you have:
| Item | Details / Link |
|---|---|
| Harness account | Database DevOps License (go to “Subscription Overview and Management”) |
| Kubernetes cluster | Kubernetes Cluster ≥ v1.18, Harness Delegate installed (Delegate setup guide) |
| Database credentials | JDBC‑compatible database; user with DDL/DML privileges. (Go to “JDBC connection strings to review connection string formats”) |
Setting up Database DevOps with Liquibase and Flyway
Harness supports both Liquibase Compatible and Flyway Compatible configurations, but the setup varies based on your preferred workflow. Before configuring your DB Schema, ensure your repository follows the correct structure and that your migration files adhere to the chosen framework’s conventions.
If you already use Liquibase or Flyway, you can skip to the section Configuring Your DB Schema.
1. Prepare Your Migration Framework (Flyway or Liquibase)
- Liquibase Compatible
- Flyway Compatible
If you are new to Liquibase, there are two main ways to create your initial changelog:
- Use existing SQL files: Recommended if you already manage your schema through SQL scripts.
- Generate a changelog: Auto-generate a changelog by diffing an existing database. Go to Build a changelog to set up your changelog using either option.
- Create Git Repo to store your DB schema files.
- Under repo, create folder sql/ and add ordered
*.sqlfiles - Add
changelog.ymlat root with:
databaseChangeLog:
- includeAll:
path: sql
Use semantic versioning in file names (e.g., "V1__init.sql", "V2__add_table.sql") for clarity and consistency.
Use semantic file names ("V1__init.sql", "V2__add_table.sql").
If you are new to Flyway, start by creating migration files that follow Flyway's naming conventions and folder structure. Go to Flyway Migration Files to understand naming conventions.
- Create a Git repository containing your schema directory.
- All migrations are stored under a folder such as "sql/migrations".
- Files follow Flyway’s naming rules:
- Versioned: "
V1__init.sql", "V2__add_table.sql" - Undo (optional): "
U2__remove_table.sql" This structure enables Flyway and Harness to consistently detect, version, and apply schema changes.
- Versioned: "
2. Configure your Database Schema
The database schema defines a set of SQL changes that can be deployed to one or more database instances. Here is how we will configure it:
- On the module picker, choose
DB DevOpsin your Harness account. - Under "DB Schemas", click “Add New DB Schema".
- Select the Migration Type (Liquibase Compatible or Flyway Compatible).
- Enter the Git repository details where your schema files are stored:
- Git Connector - The Git connector that has access to the repository containing your database schema files.
- Repository Name - The name of the Git repository where your database schema files are stored.
- Click Next and then provide the path to the changelog file (for Liquibase) or the migrations folder (for Flyway) in the repository. For example:
- For Liquibase:
changelog.yml - For Flyway:
sql/migrations
- For Liquibase:
- Click
Add DB Schema.
The primary database instance where the Liquibase changelog will be initially applied. (Once the Instance is created, you can add the primary instance by going to the DB Schema settings.)
(In case of using Author DB Change, this field is mandatory to set up the schema correctly.)
Go to Harness Git connector settings to review connector options.
3. Connect with Database Instance
Before we can deploy our Database Schema, we need to connect a database instance to which we can deploy it. Here is how:
- Under "DB Instances", click “Add New DB Instance".
- Select main (or your environment branch).
- Click New JDBC Connector and Enter Name, JDBC URL & credentials, select the Harness delegate, then Save and Finish.
- Name - A name to identify the database instance.
- JDBC URL - The JDBC connection string for your database instance. Go to JDBC connection strings to review connection string formats.
- Username - The username to connect to the database.
- Password - The password for the database user.
- Delegate - The Harness Delegate that will run the database operations.
- Click
Add Database Instance.
4. Configure your Deployment Pipeline
A deployment pipeline deploys your database changes when it runs. In addition to deploying your database, it can also deploy application changes, and have other logic such as requiring a manual approval. Here are some steps on how to create a simple pipeline that deploys a schema change to a database instance anytime it changes in git:
- Under Pipelines, Click Create a Pipeline.
- Click Add Stage and Choose Custom stage.
- Choose Add step group and Turn on Enable Containerized Stage.
- Choose the Kubernetes cluster you'd like to run on.
- Click Add Step and Choose the Apply Schema step under DB DevOps.
- For the step name, enter "Deploy Database Schema".
- Name: Name of the step, by default the name is "DBSchemaApply_1".
- Timeout: The timeout limit is the maximum allowable time a stage or pipeline can run.
- Migration Type: Liquibase Compatible or Flyway Compatible.
- Select DB Schema: The DB Schema we created on Step 2.
- Select DB Instance: The Instance we created on Step 3.
- Tag (Optional): You can add custom tags to each deployment. In case it is left empty, Harness will add the tag during the deployment.
- Click
Apply Changesand Save the Pipeline. - Now, click on "Run" and wait for your pipeline to complete.
- Visual Overview
- YAML Overview

pipeline:
name: dbops-liquibase-pipeline
identifier: dbopsliquibasepipeline
projectIdentifier: DoNotDelete_AnimeshDBOPS
orgIdentifier: Ng_Pipelines_K8s_Organisations
tags: {}
stages:
- stage:
name: dbops
identifier: dbops
description: "Deploy schema to DB instance using Liquibase"
type: Custom
spec:
execution:
steps:
- stepGroup:
name: cs
identifier: cs
steps:
- step:
type: DBSchemaApply
name: DBSchemaApply_1
identifier: DBSchemaApply_1
spec:
connectorRef: account.harnessImage
migrationType: Liquibase
dbSchema: Liquibase
dbInstance: instance
tag: "123"
timeout: 10m
- step:
type: DBSchemaRollback
name: DBSchemaRollback_1
identifier: DBSchemaRollback_1
spec:
connectorRef: account.harnessImage
migrationType: Liquibase
dbSchema: Liquibase
dbInstance: instance
tag: v1.0.0
timeout: 10m
stepGroupInfra:
type: KubernetesDirect
spec:
connectorRef: dbops
rollbackSteps: []
serviceDependencies: []
tags: {}
Conclusion
By completing the steps in this onboarding guide, you now have a fully operational Database DevOps workflow powered by Harness. Your schemas are version-controlled, your database instances are securely connected, and your pipelines are ready to execute repeatable, automated schema deployments using Liquibase or Flyway. This foundation sets the stage for enterprise-grade governance, faster release cycles, and improved developer productivity.
Next steps
As you operationalize more environments, explore advanced capabilities to deepen your Database DevOps practice.
- Go to Rollback automation to configure automated rollback for failed deployments.
- Go to Author DB Change to use LLM-powered change authoring.
- Go to the Database DevOps Troubleshooting Guide to resolve common setup and runtime errors.