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
liquibasefolder inside your project’sdatafolder, containing the generatedliquibase.propertiesfiles.
Add the script to your package.json
If your project does not already define the serverconfig2LiquibaseProperties4System script, add it under the scripts section:
"scripts": {
"Convert serverconfig.xml to Liquibase Properties for SYSTEMALIAS": "serverconfig2LiquibaseProperties4System"
}
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.
On some systems you may need to escape backslashes.
Relative path example
"scripts": {
"Convert_SYSTEMALIAS": "serverconfig2LiquibaseProperties4System ../../relativeFolder/relativeFolder2/relativeFolder3"
}
Absolute path example
"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:
- Open the Command Palette: Ctrl + Shift + P.
- Run
Liquibase: Validate...to check if the generated files are correct. - If there are issues, run
Liquibase: Edit existing Liquibase Configurationto adjust the configuration.