For the complete documentation index, see llms.txt. This page is also available as Markdown.

Database DevOps Onboarding Guide

A self-service onboarding guide for Harness DB DevOps.

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.

Before you begin

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”)

Set 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.

NOTE

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)

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.

  1. Create a Git repository to store your DB schema files.

  2. In the repository, create an sql/ folder and add ordered *.sql files.

  3. Add changelog.yml at the repository root:

databaseChangeLog:
  - includeAll:
      path: sql

Use semantic versioning in file names, such as V1__init.sql and V2__add_table.sql.

File naming

Use semantic file names, such as V1__init.sql and V2__add_table.sql.

Add New DB Liquibase Schema

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.

  1. Create a Git repository containing your schema directory.

  2. All migrations are stored under a folder such as "sql/migrations".

  3. 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.

Add New DB Flyway Schema

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:

  1. In the module picker, select DB DevOps.

  2. In DB Schemas, click Add New DB Schema.

  3. Select the migration type, either Liquibase Compatible or Flyway Compatible.

  4. 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.

  5. Click Next, then enter the changelog file path for Liquibase or migrations folder path for Flyway:

    • For Liquibase: changelog.yml

    • For Flyway: sql/migrations

  6. 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.)

If you use 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:

Add New DB Instance
  1. In DB Instances, click Add New DB Instance.

  2. Select main or your environment branch.

  3. Click New JDBC Connector, enter the name, JDBC URL, and credentials, then select the Harness Overview. Click 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.

  4. 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:

  1. In Pipelines, click Create a Pipeline.

  2. Click Add Stage, then select Custom stage.

  3. Select Add step group, then enable Enable Containerized Stage.

  4. Select the Kubernetes cluster where the pipeline runs.

  5. Click Add Step, then select Apply Schema under DB DevOps.

  6. For the step name, enter "Deploy Database Schema". dbops-step-apply-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.

  7. Click Apply Changes, then save the pipeline.

  8. Click Run and wait for the pipeline to complete.

dbops-running

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.

Last updated

Was this helpful?