snapshot

Last updated: January 21, 2026

The snapshot command captures the current state of the url database, which is the target database.

The snapshot command has two modes:

When run without options, it gathers the current state of the database and shows a text-based version of the schema to STDOUT. When run with the --snapshot-format=json option, it creates a JSON file that represents the current state of the url database. Alternatively, you can have a YAML-based output by using the --snapshot-format=yaml attribute.

Uses

The snapshot command is typically used when you want to see changes in your targetdatabase or keep a record of your current database state.

You can use the output of snapshot with the diff and diff-changelog commands.

Note: It is best practice to use the --snapshot-format=json option for the diff and diff-changelog commands. Otherwise, you will get only a text report of your target database. This text report cannot be used for comparison in the future.

It can also be used to compare:

  • A previous database state to an online database.

  • A previous database state to another snapshot.

Note: Running a diff command by using at least one snapshot.json file is faster than using a diff command with two online databases. However, keep in mind that a snapshot will no longer reflect the current state of the database if the database is changed with the update command or if it is changed manually.

In Liquibase Secure 4.26.0 and later, you can use the --snapshot-filters parameter to limit the types of database objects you include in your snapshot. If your database is very large, including only the objects relevant to you in the snapshot can improve the command's performance.

Syntax

To run the snapshot command, specify your driver, classpath, and URL in the Liquibase properties file. You can also specify these properties in your command line.

Then run the snapshot command:

liquibase snapshot

To create a JSON file, add the --snapshot-format=json attribute:

liquibase --output-file=mySnapshot.json snapshot --snapshot-format=json

To only include data types you specify, add the --snapshot-filters parameter:

liquibase snapshot --snapshot-filters=catalog,index,schema,table

Note: The username and password attributes are not required for connections and systems which use alternate means of authentication. Also, you can specify database credentials as part of the url attribute.

Command parameters

Global parameters

Attribute

Definition

Requirement

--output-file=<string>

File path to where the command output will be written. If not specified, output goes to STDOUT. See --output-file.

Optional

Command parameters

Attribute

Definition

Requirement

--url=<string>

The JDBC database connection URL.

Required

--default-catalog-name=<string>

Name of the default catalog to use for the database connection

Optional

--default-schema-name=<string>

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Note: In the properties file and JAVA_OPTS only: in 4.18.0 and earlier, specify this parameter using the syntax defaultSchemaName. In 4.19.0 and later, use the syntax liquibase.command.defaultSchemaName.

Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set --preserve-schema-case to true. However, in Liquibase 4.12.0–4.22.0, the Liquibase validator still throws a DatabaseException error if you specify a mixed-case value of defaultSchemaName. In 4.23.0 and later, the Liquibase validator accepts any casing.

Optional

--driver=<string>

The JDBC driver class

Optional

--driver-properties-file=<string>

The JDBC driver properties file

Optional

--ignore-missing-references=[true|false]

Controls behavior when snapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys) Default: false

Optional

--include-relations-for-computed-columns=[true|false]

When true, preserves the parent table relationship for computed and descending-index columns in snapshot and diff output. Default: false

Optional

--password=<string>

Password to connect to the target database.

Optional

--schemas=<string>

Specifies schemas to be able to compare a multi-schema database to its snapshot

Optional

--snapshot-filters=<string>

Liquibase Secure 4.26.0+. Controls which object types Liquibase includes in the snapshot. Specifying only the object types you need can improve command performance. Specify multiple values in a comma-separated list. Accepted values are: catalog, checkConstraint, column, databasePackage, databasePackageBody, foreignKey, function, index, primaryKey, schema, sequence, storedProcedure, synonym, table, trigger, uniqueConstraint, and view. Default: all types.

Liquibase Secure 5.1.0+. Snowflake accepted values are: catalog, checkConstraint, databasePackage, databasePackageBody, FileFormat, foreignKey, function, index, primaryKey, schema, sequence, SnowflakeDynamicTable, SnowflakeDynamicTableColumn, SnowflakeStage, SnowflakeStandardTable, SnowflakeStandardTableColumn, SnowflakeView, SnowflakeViewColumn, storedProcedure, synonym, and trigger. Note:For Snowflake, unique constraints are not snapshotted as standalone objects. Instead, uniqueness is captured as theisUniqueattribute on the column definition. Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations.

Optional

--snapshot-format=<string>

Output format to use. Creates a file of the specified type that represents the current state of the database. Valid values: JSON, YAML, TXT. Default: TXT.

Optional

--username=<string>

Username to connect to the target database.

Optional

Global parameters

Attribute

Definition

Requirement

globalArgs: { output-file: "<string>" }

File path to where the command output will be written. If not specified, output goes to STDOUT. See --output-file.

Optional

Command parameters

Attribute

Definition

Requirement

cmdArgs: { url: "<string>" }

The JDBC database connection URL.

Required

cmdArgs: { default-catalog-name: "<string>" }

Name of the default catalog to use for the database connection

Optional

cmdArgs: { default-schema-name: "<string>" }

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Note: In the properties file and JAVA_OPTS only: in 4.18.0 and earlier, specify this parameter using the syntax defaultSchemaName. In 4.19.0 and later, use the syntax liquibase.command.defaultSchemaName.

Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set --preserve-schema-case to true. However, in Liquibase 4.12.0–4.22.0, the Liquibase validator still throws a DatabaseException error if you specify a mixed-case value of defaultSchemaName. In 4.23.0 and later, the Liquibase validator accepts any casing.

Optional

cmdArgs: { driver: "<string>" }

The JDBC driver class

Optional

cmdArgs: { driver-properties-file: "<string>" }

The JDBC driver properties file

Optional

cmdArgs: { ignore-missing-references: "<true|false>" }

Controls behavior whensnapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys) Default: false

Optional

cmdArgs: { include-relations-for-computed-columns: "<true|false>" }

When true, preserves the parent table relationship for computed and descending-index columns in snapshot and diff output. Default: false

Optional

cmdArgs: { password: "<string>" }

Password to connect to the target database.

Optional

cmdArgs: { schemas: "<string>" }

Specifies schemas to be able to compare a multi-schema database to its snapshot

Optional

cmdArgs: { snapshot-filters: "<string>" }

Liquibase Secure 4.26.0+. Controls which types of objects Liquibase includes in the snapshot. Can improve command performance. Specify multiple values in a comma-separated list. Accepted values are: catalog, checkConstraint, column, databasePackage, databasePackageBody, foreignKey, function, index, primaryKey, schema, sequence, storedProcedure, synonym, table, trigger, uniqueConstraint, and view. Default: all types.

Liquibase Secure 5.1.0+. Snowflake accepted values are: catalog, checkConstraint, databasePackage, databasePackageBody, FileFormat, foreignKey, function, index, primaryKey, schema, sequence, SnowflakeDynamicTable, SnowflakeDynamicTableColumn, SnowflakeStage, SnowflakeStandardTable, SnowflakeStandardTableColumn, SnowflakeView, SnowflakeViewColumn, storedProcedure, synonym, and trigger. Note:For Snowflake, unique constraints are not snapshotted as standalone objects. Instead, uniqueness is captured as theisUniqueattribute on the column definition. Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations.

Optional

cmdArgs: { snapshot-format: "<string>" }

Output format to use. Creates a file of the specified type that represents the current state of the database. Valid values: JSON, YAML, TXT. Default: TXT.

Optional

cmdArgs: { username: "<string>" }

Username to connect to the target database.

Optional

Global parameters

Attribute

Definition

Requirement

liquibase.outputFile: <string>

File path to where the command output will be written. If not specified, output goes to STDOUT. See --output-file.

Optional

Command parameters

Attribute

Definition

Requirement

liquibase.command.url: <string>

liquibase.command.snapshot.url: <string>

The JDBC database connection URL.

Required

liquibase.command.defaultCatalogName: <string>

liquibase.command.snapshot.defaultCatalogName: <string>

Name of the default catalog to use for the database connection

Optional

liquibase.command.defaultSchemaName: <string>

liquibase.command.snapshot.defaultSchemaName: <string>

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Note: In the properties file and JAVA_OPTS only: in 4.18.0 and earlier, specify this parameter using the syntax defaultSchemaName. In 4.19.0 and later, use the syntax liquibase.command.defaultSchemaName.

Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set --preserve-schema-case to true. However, in Liquibase 4.12.0–4.22.0, the Liquibase validator still throws a DatabaseException error if you specify a mixed-case value of defaultSchemaName. In 4.23.0 and later, the Liquibase validator accepts any casing.

Optional

liquibase.command.driver: <string>

liquibase.command.snapshot.driver: <string>

The JDBC driver class

Optional

liquibase.command.driverPropertiesFile: <string>

liquibase.command.snapshot.driverPropertiesFile: <string>

The JDBC driver properties file

Optional

liquibase.command.ignoreMissingReferences=[true|false] or liquibase.command.diff.ignoreMissingReferences=[true|false]

Controls behavior when snapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys) Default: false

Optional

liquibase.command.include-relations-for-computed-columns=[true|false]

When true, preserves the parent table relationship for computed and descending-index columns in snapshot and diff output. Default: false

Optional

liquibase.command.password: <string>

liquibase.command.snapshot.password: <string>

Password to connect to the target database.

Optional

liquibase.command.schemas: <string>

liquibase.command.snapshot.schemas: <string>

Specifies schemas to be able to compare a multi-schema database to its snapshot

Optional

liquibase.command.snapshotFilters: <string>

liquibase.command.snapshot.snapshotFilters: <string>

Liquibase Secure 4.26.0+. Controls which types of objects Liquibase includes in the snapshot. Can improve command performance. Specify multiple values in a comma-separated list. Accepted values are: catalog, checkConstraint, column, databasePackage, databasePackageBody, foreignKey, function, index, primaryKey, schema, sequence, storedProcedure, synonym, table, trigger, uniqueConstraint, and view. Default: all types.

Liquibase Secure 5.1.0+. Snowflake accepted values are: catalog, checkConstraint, databasePackage, databasePackageBody, FileFormat, foreignKey, function, index, primaryKey, schema, sequence, SnowflakeDynamicTable, SnowflakeDynamicTableColumn, SnowflakeStage, SnowflakeStandardTable, SnowflakeStandardTableColumn, SnowflakeView, SnowflakeViewColumn, storedProcedure, synonym, and trigger. Note:For Snowflake, unique constraints are not snapshotted as standalone objects. Instead, uniqueness is captured as theisUniqueattribute on the column definition. Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations.

Optional

liquibase.command.snapshotFormat: <string>

liquibase.command.snapshot.snapshotFormat: <string>

Output format to use. Creates a file of the specified type that represents the current state of the database. Valid values: JSON, YAML, TXT. Default: TXT.

Optional

liquibase.command.username: <string>

liquibase.command.snapshot.username: <string>

Username to connect to the target database.

Optional

Global parameters

Attribute

Definition

Requirement

JAVA_OPTS=-Dliquibase.outputFile=<string>

File path to where the command output will be written. If not specified, output goes to STDOUT. See --output-file.

Optional

Command parameters

Attribute

Definition

Requirement

JAVA_OPTS=-Dliquibase.command.url=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.url=<string>

The JDBC database connection URL.

Required

JAVA_OPTS=-Dliquibase.command.defaultCatalogName=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.defaultCatalogName=<string>

Name of the default catalog to use for the database connection

Optional

JAVA_OPTS=-Dliquibase.command.defaultSchemaName=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.defaultSchemaName=<string>

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Note: In the properties file and JAVA_OPTS only: in 4.18.0 and earlier, specify this parameter using the syntax defaultSchemaName. In 4.19.0 and later, use the syntax liquibase.command.defaultSchemaName.

Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set --preserve-schema-case to true. However, in Liquibase 4.12.0–4.22.0, the Liquibase validator still throws a DatabaseException error if you specify a mixed-case value of defaultSchemaName. In 4.23.0 and later, the Liquibase validator accepts any casing.

Optional

JAVA_OPTS=-Dliquibase.command.driver=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.driver=<string>

The JDBC driver class

Optional

JAVA_OPTS=-Dliquibase.command.driverPropertiesFile=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.driverPropertiesFile=<string>

The JDBC driver properties file

Optional

Unix Dliquibase.ignoreMissingReferences=[true|false] Windows D"liquibase.ignoreMissingReferences"=[true|false]

Controls behavior when snapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys) Default: false

Optional

Unix Dliquibase.includeRelationsForComputedColumns=[true|false] Windows D"liquibase.includeRelationsForComputedColumns"=[true|false]

When true, preserves the parent table relationship for computed and descending-index columns in snapshot and diff output. Default: false

Optional

JAVA_OPTS=-Dliquibase.command.password=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.password=<string>

Password to connect to the target database.

Optional

JAVA_OPTS=-Dliquibase.command.schemas=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.schemas=<string>

Specifies schemas to be able to compare a multi-schema database to its snapshot

Optional

JAVA_OPTS=-Dliquibase.command.snapshotFilters=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.snapshotFilters=<string>

Liquibase Secure 4.26.0+. Controls which types of objects Liquibase includes in the snapshot. Can improve command performance. Specify multiple values in a comma-separated list. Accepted values are: catalog, checkConstraint, column, databasePackage, databasePackageBody, foreignKey, function, index, primaryKey, schema, sequence, storedProcedure, synonym, table, trigger, uniqueConstraint, and view. Default: all types.

Liquibase Secure 5.1.0+. Snowflake accepted values are: catalog, checkConstraint, databasePackage, databasePackageBody, FileFormat, foreignKey, function, index, primaryKey, schema, sequence, SnowflakeDynamicTable, SnowflakeDynamicTableColumn, SnowflakeStage, SnowflakeStandardTable, SnowflakeStandardTableColumn, SnowflakeView, SnowflakeViewColumn, storedProcedure, synonym, and trigger. Note:For Snowflake, unique constraints are not snapshotted as standalone objects. Instead, uniqueness is captured as theisUniqueattribute on the column definition. Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations.

Optional

JAVA_OPTS=-Dliquibase.command.snapshotFormat=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.snapshotFormat=<string>

Output format to use. Creates a file of the specified type that represents the current state of the database. Valid values: JSON, YAML, TXT. Default: TXT.

Optional

Unix: JAVA_OPTS=-Doracle.jdbc.useFetchSizeWithLongColumn=<true|false>

Windows: JAVA_OPTS=-D"Doracle.jdbc.useFetchSizeWithLongColumn"=<true|false>

Liquibase Secure 5.1+ This is a JVM system property that controls how the Oracle JDBC driver handles fetch sizes when querying tables containing LONG or LONG RAW columns. It is available in Liquibase 5.1.0 and later. The default value istrue, which enables optimized batch fetching for improved performance on Oracle databases. You can set this property tofalseif you need more controlled memory usage when working with large LONG or LONG RAW data types. Uses

You might want to set this property tofalsein scenarios where: Memory constraints Your environment has limited memory resources and you need more controlled fetching to prevent the driver from eagerly loading large amounts of data Large LONG/LONG RAW data You're working with very large LONG or LONG RAW data types and need to manage how data is fetched to avoid memory issues Resource management Your application requires fine-grained control over memory usage when processing large-scale data

Optional

JAVA_OPTS=-Dliquibase.command.username=<string>

JAVA_OPTS=-Dliquibase.command.snapshot.username=<string>

Username to connect to the target database.

Optional

Global parameters

Attribute

Definition

Requirement

LIQUIBASE_OUTPUT_FILE=<string>

File path to where the command output will be written. If not specified, output goes to STDOUT. See --output-file.

Optional

Command parameters

Attribute

Definition

Requirement

LIQUIBASE_COMMAND_URL=<string>

LIQUIBASE_COMMAND_SNAPSHOT_URL=<string>

The JDBC database connection URL.

Required

LIQUIBASE_COMMAND_DEFAULT_CATALOG_NAME=<string>

LIQUIBASE_COMMAND_SNAPSHOT_DEFAULT_CATALOG_NAME=<string>

Name of the default catalog to use for the database connection

Optional

LIQUIBASE_COMMAND_DEFAULT_SCHEMA_NAME=<string>

LIQUIBASE_COMMAND_SNAPSHOT_DEFAULT_SCHEMA_NAME=<string>

Name of the default schema to use for the database connection. If defaultSchemaName is set, then objects do not have to be fully qualified. This means you can refer to just mytable instead of myschema.mytable.

Note: In the properties file and JAVA_OPTS only: in 4.18.0 and earlier, specify this parameter using the syntax defaultSchemaName. In 4.19.0 and later, use the syntax liquibase.command.defaultSchemaName.

Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set --preserve-schema-case to true. However, in Liquibase 4.12.0–4.22.0, the Liquibase validator still throws a DatabaseException error if you specify a mixed-case value of defaultSchemaName. In 4.23.0 and later, the Liquibase validator accepts any casing.

Optional

LIQUIBASE_COMMAND_DRIVER=<string>

LIQUIBASE_COMMAND_SNAPSHOT_DRIVER=<string>

The JDBC driver class

Optional

LIQUIBASE_COMMAND_IGNORE_MISSING_REFERENCES=[true|false]

Controls behavior when snapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys) Default: false

Optional

LIQUIBASE_COMMAND_INCLUDE_RELATIONS_FOR_COMPUTED_COLUMNS=[true|false]

When true, preserves the parent table relationship for computed and descending-index columns in snapshot and diff output. Default: false

Optional

LIQUIBASE_COMMAND_DRIVER_PROPERTIES_FILE=<string>

LIQUIBASE_COMMAND_SNAPSHOT_DRIVER_PROPERTIES_FILE=<string>

The JDBC driver properties file

Optional

LIQUIBASE_COMMAND_PASSWORD=<string>

LIQUIBASE_COMMAND_SNAPSHOT_PASSWORD=<string>

Password to connect to the target database.

Optional

LIQUIBASE_COMMAND_SCHEMAS=<string>

LIQUIBASE_COMMAND_SNAPSHOT_SCHEMAS=<string>

Specifies schemas to be able to compare a multi-schema database to its snapshot

Optional

LIQUIBASE_COMMAND_SNAPSHOT_FILTERS=<string>

LIQUIBASE_COMMAND_SNAPSHOT_SNAPSHOT_FILTERS=<string>

Liquibase Secure 4.26.0+. Controls which types of objects Liquibase includes in the snapshot. Can improve command performance. Specify multiple values in a comma-separated list. Accepted values are: catalog, checkConstraint, column, databasePackage, databasePackageBody, foreignKey, function, index, primaryKey, schema, sequence, storedProcedure, synonym, table, trigger, uniqueConstraint, and view. Default: all types.

Liquibase Secure 5.1.0+. Snowflake accepted values are: catalog, checkConstraint, databasePackage, databasePackageBody, FileFormat, foreignKey, function, index, primaryKey, schema, sequence, SnowflakeDynamicTable, SnowflakeDynamicTableColumn, SnowflakeStage, SnowflakeStandardTable, SnowflakeStandardTableColumn, SnowflakeView, SnowflakeViewColumn, storedProcedure, synonym, and trigger. Note:For Snowflake, unique constraints are not snapshotted as standalone objects. Instead, uniqueness is captured as theisUniqueattribute on the column definition. Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations.

Optional

LIQUIBASE_COMMAND_SNAPSHOT_FORMAT=<string>

LIQUIBASE_COMMAND_SNAPSHOT_SNAPSHOT_FORMAT=<string>

Output format to use. Creates a file of the specified type that represents the current state of the database. Valid values: JSON, YAML, TXT. Default: TXT.

Optional

LIQUIBASE_COMMAND_USERNAME=<string>

LIQUIBASE_COMMAND_SNAPSHOT_USERNAME=<string>

Username to connect to the target database.

Optional

Snapshot output examples

Liquibase Community 4.9.1 by Liquibase
Output saved to C:\Users\Documents\Maven_h2\mySnapshot.json
Liquibase command 'snapshot' was executed successfully.

loading

The snapshot command produces a JSON file that contains all your objects and places the file in the same directory as your changelog.

loading