Write and sync profiles
Writing is a two-step workflow: save a preview, inspect it, then apply explicitly to the same destination with the same policies. The default mode is create; existing-profile updates require an explicit supported mode.
Inspect availability
heidisql-js write-status --file ./portable_settings.txt --jsonThis is read-only. It reports destination revision, process/lock availability and diagnostics; availability depends on the selected native application and platform. Unknown or busy availability prevents apply. For supported native storage and settings, read the application writing guide.
Save a preview
heidisql-js write --file ./portable_settings.txt --input profiles.json --preview plan.json --jsonprofiles.json must contain supported normalized write intent, not compact list output. Use your API adapter or a selected sync source to construct it. This command creates the preview file with create-only semantics and leaves native settings unchanged. Existing plan.json is refused.
Preview cross-app sync
Use sync --from <application> with its explicit source selector, --profile, --target-path and a connection ID when the profile has multiple connections. Source adapters are allowlisted and must already be installed. Sync copies supported metadata, not stored secret values, key contents or host-trust policy. Complete command help documents the accepted selectors.
Apply a reviewed preview
Close the destination application and inspect the saved changes and diagnostics first:
heidisql-js apply --file ./portable_settings.txt --plan plan.json --jsonApply rechecks the preview, current revision, destination identity, process/lock availability and write policy. It retains recovery backups. Built-in native commit backends require Windows; file reads and previews are usable on other supported systems. Registry transactional/guarded modes have distinct guarantees; guarded mode requires explicit selection and is non-atomic. Backups may contain the original stored credentials and must remain private.
Understand the result
Preview/apply fields depend on native storage and supported projection. The captured output reference includes actual preview, stale-plan refusal and busy-lock refusal examples where exercised. The shared writing guide explains revision guards, backup/recovery and registry policies. No force flag bypasses unknown availability.