Rollback Report

The Liquibase CLI input and output of a rollback (runtime summary) followed by changeset execution details.

The rollback report is a Liquibase operation report that informs you of system, runtime, operation, and changeset information about your database rollbacks in a human-readable format.

In Liquibase 4.27.0 and later, you can automatically generate a database rollback report using the Liquibase rollback family of commands: rollback, rollback-count, rollback-one-changeset, rollback-one-update, and rollback-to-date. In Liquibase 4.28.0 and later, you can also generate a rollback report as part of the update-testing-rollback command.

Uses

Using Liquibase rollback reports can help developers, DBAs, DevOps engineers, and managers in the following ways:

  • Understand and share the data on the execution of rollback commands
  • Easily scan and understand a high-level overview of the changesets rolled back
  • Get a detailed view of both successful and failed rollbacks
  • Collaborate with your team with shareable reports in PDF format

Enable operation reports

In Liquibase 4.29.0 and later, operation reports are enabled by default.

In older versions, operation reports are disabled by default. To enable all operation reports, you must:

  1. Set the --license-key property using your Liquibase Pro license key.
  2. Choose how often to generate reports. You can either:
    • Always generate reports:
    • Selectively generate reports once at runtime:
      • Command line: liquibase rollback --report-enabled=true
      • Environment variable: LIQUIBASE_COMMAND_ROLLBACK_REPORT_ENABLED=true
      • JVM system property: JAVA_OPTS="-Dliquibase.report.enabled=true" liquibase rollback

Rollback reports in automation

To automatically use Liquibase rollback reports in your CI/CD pipeline, follow these steps in your CI/CD tool:

  1. Create a LiquibaseRollbackReport job that generates the rollback report. This job must:
    1. Enable the rollback report with --reports-enabled (global scope) or --report-enabled (command scope).
    2. Run a Liquibase rollback* command against your database.

    Tip: For more information, see the Examples section of this page.

Examples

Setting parameters

You can modify the rollback report output with the parameters listed in the tables on this page. In the CLI, global parameters go to the left of the command and command parameters go to the right of the command.

liquibase \
    --reports-enabled=true \
    --reports-path=reports \
    --reports-name=rollback_report.html \
  rollback \
    --changelog-file="example-changelog.xml"

Note: For readability, this page shows parameters on new lines. If you type in the commands on a single line, do not include the backslashes \ shown in the examples.

You can also set parameters in your liquibase.properties file, as environment variables, or in a flow file. For a list of parameters and their syntax in each format, see the Global parameters and Command parameters sections of this page.

Disable reports by default; enable only the rollback report

If you want to keep reports disabled by default and enable only the rollback report, you can use the command parameter --report-enabled (singular) on a rollback family command. For example:

liquibase rollback \
    --report-enabled=true \
    --report-name=my_rollback_report.html

Parameters

Global parameters

Use these parameters to control the behavior of all operation reports.

Parameter Type Description Requirement

--reports-enabled=<true|false>

Boolean Enables or disables all reports at the global level. Overridden by --report-enabled at the command level. Default: false. Required (either this or --report-enabled)

--reports-name=<string>

String Specifies the name of the report file at the global level. Overridden by --report-name at the command level. By default, Liquibase generates a new report file labeled with a timestamp (user's local time). If you set a custom name, Liquibase overwrites the existing file every time you generate a new report. Default: report-<DD-Mon-YYYY-HHmmss>.html. Optional

--reports-open=<true|false>

Boolean Specifies whether to automatically open the report in your default browser at the global level. Overridden by --report-open at the command level. Default: true. Optional

--reports-path=<string>

String Specifies the file path to the report file at the global level. Overridden by --report-path at the command level. Default: ./ Optional

Command parameters

Use these command parameters if you want to specify operation report behavior for a specific command.

Parameter Type Description Requirement

--report-enabled=<true|false>

Boolean

Enables a report at the command level. Overrides the global argument --reports-enabled. Default: false.

Required (either this or --reports-enabled)

--report-name=<string>

String

Specifies the name of the report file at the command level. Overrides the global argument --reports-name. By default, Liquibase generates a new report file labeled with a timestamp (user's local time). If you set a custom name, Liquibase overwrites the existing file every time you generate a new report. Default: report-<DD-Mon-YYYY-HHmmss>.html.

Optional

--report-open=<true|false>

Boolean

If true, automatically opens the report in your default browser. Default: false.

Note: Prior to Liquibase 4.29.0, this parameter was called --open-report instead of --report-open.

Optional

--report-path=<string>

String

Specifies the file path to the report file at the command level. Overrides the global argument --reports-path. Default: ./.

Optional

Related videos

Learn more about Rollback Reports in Liquibase Pro