syncHub command synchronizes the local DATABASECHANGELOG table with Liquibase Hub.
syncHub 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
dropAllwere run while Liquibase Hub was offline.
When you run the
syncHub command, you will not see any operations added to the Project associated with your changelog.
syncHub cannot associate previous Liquibase operations, so you will not see any operations in Liquibase Hub. You will only see changesets added to the changesets tab in your Liquibase Hub project.
To run the
syncHub command, you can specify the driver, classpath, URL, and user authentication information in your
liquibase.properties file. For more information, see Creating and configuring a liquibase.properties file. You can also specify these properties in your command line.
Also, the following items are required:
- The Liquibase Hub API Key
liquibase.hub.ApiKeyvalue in the
There are three ways to specify your API Key:
liquibaseHubApiKeyon the command line:
- Specifying API key in your JAVA_OPTS Environment Variable as
- On Linux or MacOS:
- On Windows:
- On Linux or MacOS:
Note: To retrieve or manage your API keys, go to Settings > API Keys by selecting the settings icon on the left side of the page.
- The changelog file
The first time you run the
syncHub command, Liquibase Hub doesn’t know what your connection is. Therefore, add the
--changeLogFile attribute to the
If you entered the
changeLogFile attribute, there is no need to specify
hubConnectionId with the command. If you use
hubConnectionId, add it to the
syncHub command on the command line.
liquibase syncHub --hubConnectionId=myConnectionId
Note: You can find the
hubConnectionId in Project > View Details > Connections > View Status.
Before running the
syncHub command, register your changelog file by using the
liquibase --changeLogFile=mychangelog.xml registerChangeLog
registerChangeLog command connects your local Liquibase activity to a specific Liquibase Hub Project.
Next, run the
syncHub command attributes
Specifies the connection needed for the
C:\dev\DaticalDB-testing\liquibase-pro-cli-project\oracle_lbpro_master>..\liquibase --changeLogFile=oracle_lbpro_master_changelog.xml syncHub Starting Liquibase at 15:23:41 (version 4.0.1-DAT-4987-SNAPSHOT #6 built at 2020-08-31 21:09+0000) Successful Liquibase command 'syncHub' was executed successfully.