Skip to main content

Convert server configuration of the SYSTEMALIAS to liquibase.properties

To use the Liquibase Extension for VS Code, you often need corresponding liquibase.properties files.
This devtools script simplifies the conversion from server configuration files (serverconfig.xml) to liquibase.properties.

The script:

  • scans your server configuration files, and
  • creates a liquibase folder inside your project’s data folder, containing the generated liquibase.properties files.

Add the script to your package.json

If your project does not already define the serverconfig2LiquibaseProperties4System script, add it under the scripts section:

package.json
"scripts": {
"Convert serverconfig.xml to Liquibase Properties for SYSTEMALIAS": "serverconfig2LiquibaseProperties4System"
}
note

The script name you define in scripts is arbitrary. Use a name that fits your project conventions.

Configure parameters in package.json

You can specify where your server configurations are stored to control from where liquibase.properties files are generated. You can:

  • use a relative path (starting from the project root),
  • use an absolute path, or
  • leave it empty if your server configurations are in the default location: yourProjectFolder/data/configs.
note

On some systems you may need to escape backslashes.

Relative path example

Relative path example in the package.json
"scripts": {
"Convert_SYSTEMALIAS": "serverconfig2LiquibaseProperties4System ../../relativeFolder/relativeFolder2/relativeFolder3"
}

Absolute path example

Absolute path example in the package.json
"scripts": {
"Convert_SYSTEMALIAS": "serverconfig2LiquibaseProperties4System C:/User/Name/Somewhere/In/Your/System"
}

Run the script after changes

Run your script. If the conversion succeeds, a new folder named liquibase is created inside your data folder, containing one or more liquibase.properties files.

Test the generated files

Use the Liquibase extension in VS Code:

  1. Open the Command Palette: Ctrl + Shift + P.
  2. Run Liquibase: Validate... to check if the generated files are correct.
  3. If there are issues, run Liquibase: Edit existing Liquibase Configuration to adjust the configuration.