sync-hub

Tip: As of February 2023, we no longer accept new registrations in Hub. Please get in touch with customer support with any questions. Learn more about the plan to sunset Liquibase Hub here: liquibase-hub-sunset

The sync-hub command synchronizes the local DATABASECHANGELOG table with Liquibase Hub.

Uses

The sync-hub command is typically used when you want to:

  • Ensure that Liquibase Hub shows the latest results from your DATABASECHANGELOG table.
  • Synchronize the DATABASECHANGELOG table of a new project that has pre-existing data in the DATABASECHANGELOG table.
  • Synchronize your local data if update, rollback, changelog-sync, or drop-all were run while Liquibase Hub was offline.

When you run the sync-hub command, you will not see any operations added to the Project associated with your changelog. sync-hub cannot associate previous Liquibase operations. You will only see changesets added to the changesets tab in your Liquibase Hub project.

Syntax

To run the register-changelog command, specify the following parameters in the Liquibase properties file, environment variables, or the command prompt while running the command:

Tip: For more information about the options to store parameters, see Create and Configure a liquibase.properties File, Liquibase Environment Variables, and JAVA_OPTS Environment Variable. To find the format of the parameter, see Liquibase Parameters.

  • Driver, URL, and user authentication information such as username and password
  • Liquibase Hub API key
  • changelog file
  • Note: If you have not registered your changelog file, use the register-changelog command. The register-changelog command connects your local Liquibase activity to a specific Liquibase Hub Project.

  • Target ID specified by the hub-connection-id parameter
  • Note: If you have the changelog-file parameter, there is no need to specify the hub-connection-id parameter with the command. If you use hub-connection-id, add it to the sync-hub command at the command prompt.

    Tip: To find the hub-connection-id, select Projects > View Details for the required project > Targets > View Status > Target ID.

Run the sync-hub command:

liquibase sync-hub

Command arguments

Tip: For best results, specify all commands and parameters in the --kebab-case format in the CLI. If your preference is camelCase, it also works in the CLI.

Attribute Definition Requirement
--url

The JDBC database connection URL. See Using JDBC URL in Liquibase.

Required
--changelog-file

The root changelog

Optional
--default-catalog-name

Name of the default catalog to use for the database connection

Optional
--default-schema-name

Name of the default schema to use for the database connection

Optional
--driver

The JDBC driver class

Optional
--driver-properties-file

The JDBC driver properties file

Optional
--hub-connection-id

Specifies the target (also called connection) needed for the sync-hub command to synchronize the local DATABASECHANGELOG table with Liquibase Hub. This parameter is available in your Project at https://hub.liquibase.com.

Optional
--hub-project-id

Identifies the specific Project in which to record your data at Liquibase Hub. The parameter is available in your account at https://hub.liquibase.com.

Optional
--password

Password to connect to the target database

Optional
--username

Username to connect to the target database

Optional

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.

Output

Liquibase Community 4.9.1 by Liquibase
Liquibase command 'sync-hub' was executed successfully.

Related links