7 stable releases
Uses new Rust 2024
| new 3.20.7 | Jan 19, 2026 |
|---|---|
| 3.20.4 | Jan 12, 2026 |
| 3.20.1 | Jan 5, 2026 |
| 3.19.13 | Dec 26, 2025 |
| 3.19.8 | Dec 19, 2025 |
#314 in Database interfaces
Used in shvclient
290KB
6K
SLoC
shvbroker-rs
Rust implementation of SHV broker
Install
Use CI build on releases
Build
cargo build --release --all-features
Run
Print default config
./shvbroker --print-config
Edit config, save config, run broker
./shvbroker --config myconfig.yaml
Migrating Legacy SHVBroker Configuration
Overview
shvbroker_migrate_legacy is a command-line tool used to convert legacy C++ SHVBroker configuration and access database files into the YAML and SQLite formats used by shvbroker-rs.
This migration process includes:
- Converting the legacy
.cfgconfiguration file toshvbroker.yml - Migrating the legacy Access-style
.dbfile toshvbroker.sqlite - Preserving users, mounts, and roles data in the new format
Usage
shvbroker_migrate_legacy --legacy-config <LEGACY_CONFIG_PATH> [--result-config <RESULT_CONFIG_PATH>]
Required Arguments
| Flag | Description |
|---|---|
--legacy-config <PATH> |
Path to the legacy SHVBroker configuration file (in CPON format, e.g., shvbroker.cfg). |
Optional Arguments
| Flag | Description |
|---|---|
--result-config <PATH> |
Output path for the converted YAML configuration file. If not specified, the tool will write shvbroker.yml in the same directory as the legacy file. |
Examples
Convert a legacy config file in-place
shvbroker_migrate_legacy --legacy-config /etc/shvbroker/shvbroker.cfg
What this does:
- Reads the legacy configuration from
/etc/shvbroker/shvbroker.cfg. - Writes the converted YAML to
/etc/shvbroker/shvbroker.yml(same directory by default). - If the legacy configuration refers to an access DB (for example
shvbroker.cfg.db), migrates it toshvbroker.sqlitein the configured data directory.
Specify a custom output path
shvbroker_migrate_legacy \
--legacy-config /etc/shvbroker/shvbroker.cfg \
--result-config /tmp/new_shvbroker.yml
This saves the converted configuration to /tmp/new_shvbroker.yml instead of the default shvbroker.yml in the config directory.
Database Migration Details
If the legacy configuration enables access database (i.e. use_access_db: true in the migrated config), the tool will:
- Determine the data directory:
- If the
data_directoryin the newbroker_configis a relative path, it will be joined with the config file's directory. - If
data_directoryis absolute, it will be used as-is.
- If the
- Locate the legacy DB file:
- Uses the database field from the legacy SQL config if present, extracting only the filename (e.g.
shvbroker.cfg.db). - If missing, defaults to
shvbroker.cfg.db.
- Uses the database field from the legacy SQL config if present, extracting only the filename (e.g.
- Create a new SQLite database
shvbroker.sqlitein the data directory. - Migrate the following tables/objects from the legacy DB into the new DB:
- users
- mounts
- roles
The tool reads the legacy DB in read-only mode and writes the new DB using the updated schema.
Dependencies
~45–69MB
~1M SLoC