In this tutorial, you will learn how to get up and running with Liquibase.
If you are brand new to Liquibase, we recommend you begin by downloading the Liquibase Installer. You can then skip ahead to the Using the Liquibase Installer topic to learn more about the Liquibase Developer Workflow.
There are many ways to download and install Liquibase manually depending on how you choose to use it. If you decide not to use the Liquibase installer (which comes with tons of example files to help you learn the Liquibase Developer Workflow before using your own database), then you can view the Liquibase Installation Documentation for more information on other ways to download and install Liquibase.
Liquibase allows you to specify options on the command line which means the Liquibase CLI does not require configuration.
However, creating a
liquibase.properties file allows you to save default values so you don’t have to specify them in the CLI unless you want to.
Liquibase will always override a
liquibase.properties file in favor of a value specified on the command line.
If you used the installer, your Liquibase download includes example
liquibase.properties files for both XML and SQL formats in your Liquibase directory.
We recommend that you move on to the Using the Liquibase Installer topic next.
The manual installation method does not contain a
liquibase.properties file. You can view the Creating and Configuring a liquibase.properties file topic for more information on how to do this.
Before moving on to the next lesson, you must select your path. If you used the Liquibase Installer, you will learn how to move through the Liquibase Developer Workflow using example files that were included with your install.
If you installed manually, there are two paths to choose from based on how you want to define your changes.
If you used the Liquibase Installer, the download includes an example H2 database, an XML changelog &
liquibase.properties file, an SQL changelog &
liquibase.properties file, and an AdoptOpenJDK binary.
The purpose of these files is to walk you through the Liquibase Developer workflow while using tons of examples.
If you installed Liquibase using a manual method, there are two ways Liquibase allows you to define changes to the database:
Choosing this path means that your changes are defined in XML, JSON, or YAML formats. Liquibase will create XML formatted changelogs that define your changeSets, then generate and deploy SQL to your database based on those changeSets. Liquibase will also track all database migrations in your changelog.
Choosing this path means that you can define your own changes in SQL format. Liquibase will create SQL formatted changelogs that define your changeSets, then generate and deploy those changes to your database automatically. Liquibase supports plain SQL scripts designed to be custom or specific to your database and can even reference multiple script files in your changelogs.
In this tutorial we covered: