Export connections and run files
The CLI never asks for a host or a password on the command line. You set connections up and test them in the desktop app, then export them as encrypted files.
On this page
Two kinds of file
| File | Contains | Use it for |
|---|---|---|
.dbhconn | One connection | Pairing any source with any target: --source a.dbhconn --target b.dbhconn |
.dbhrun | A source, a target and a saved profile’s choices | A repeatable release or refresh: --run release.dbhrun |
A run file carries the profile’s schema choices, including which schemas to compare, the sync mode and the objects you selected, so the pipeline compares exactly what you reviewed. Connection files compare with default choices.
Export from the desktop app
- Choose File, then Export for CLI. You can also right-click a connection, or a saved profile to create a run file.
- Give the file a label, such as “Production orders” (up to 80 characters).
- Decide whether to include the database password.
- Choose how long the file works: 30, 90 or 365 days.
- Enter a passphrase, or choose Generate.
- Check the summary of what the file contains, then save it. The desktop app registers it with your dbHydrate account.
Export options
| Option | Choices | Advice |
|---|---|---|
| Label | Up to 80 characters | Readable without the passphrase, so don’t put secrets or hostnames in it. |
| Include password | Off (default) or on | Leave it off for production and supply the password from your CI secret store. |
| Lifetime | 30, 90 or 365 days (default 365) | There is no “never expires”. Shorter is safer for production. |
| Passphrase | At least 12 characters, or Generate | Store it separately from the file, for example in your CI secret store. |
What a file contains
| Part | Contents |
|---|---|
| Readable header, signed | File ID, kind, engine, label, environments, owner type, created and expiry dates, encryption settings |
| Encrypted | Host, port, database, user, SSL settings and certificates, SSH tunnel settings and keys, SQL Server sign-in and encryption options, environment protection settings, the profile’s choices, and the password if you included it |
| Never included | Your master password, other connections, query history, run history or any data |
The safety settings travel with the connection. A connection you marked Production or read-only is treated the same way by the CLI.
Files without a password
A file exported without a password needs it at run time:
export DBHYDRATE_TARGET_PASSWORD="$PROD_DB_PASSWORD" # from your CI secret store
dbhydrate compare --run release.dbhrunIf such a file leaks, it can’t connect to your database on its own. When you change a database password, files without a password keep working; update the secret instead of re-exporting.
Where to keep files and passphrases
- The file is encrypted, so it can live in your repository next to the pipeline that uses it.
- Keep the passphrase, any passwords and the license key in your CI system’s secret store, never in the repository.
- Use a different passphrase for production files than for test files.
Limits
- SQL Server connections using Windows authentication can’t be exported, because that sign-in belongs to a Windows account and doesn’t travel to another machine. Use a SQL Server login instead.
- A connection marked read-only can only be used as a source.
- Trials can export files. The files run
compareanddry-run;applyneeds a license. - A file belongs to the seat or trial that exported it. Another seat’s license key can’t apply it.
- An exported file is a snapshot. Changes you make to the connection in the desktop app afterwards need a new export.
Revoke, expire and re-export
Your dbHydrate account lists every exported file with its label, kind, engine, seat, expiry, last use and status. Revoke a file and it stops working everywhere at once, because its key share is deleted. Files also stop on their own when they expire. Export a new file when you need one; the old one can’t be extended.